darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

How can I make iframe draggable? #174

Closed hanj99 closed 9 years ago

hanj99 commented 9 years ago

I'm using a sly horizontal scrolling with a satisfaction :)

But, when I'm mixing images with iframe( which is used to play youtube video ), I can't drag horizontally on the video area. Is there any way I can get scrolling?

<div id="sly_container" class="frame">
    <ul class="slidee list_screenshot">
       <li>
          <iframe src="http://youtube.com/xxx" frameborder="0"></iframe>  // not draggable here
       </li>
       <li>
          <img src="source_url"/>  // draggable
       </li>
       <li>
           ....
       </li>
     </ul>
</div>
darsain commented 9 years ago

You can't. All the mouse events triggered in an iframe are kept inside an iframe. You'd need a non-trivial events passing implementation to make it work. And I don't know about any, nor do I know about anyone that tried doing something like that.

hanj99 commented 9 years ago

Thank you for your reply. I would have to change video area with a screenshot and inject a link on it.