Created
April 20, 2010 19:36
-
-
Save ryan5500/372950 to your computer and use it in GitHub Desktop.
jquery-ui droppable bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="jquery.js"></script> | |
| <script type="text/javascript" src="jquery-ui.js"></script> | |
| <script type="text/javascript" src="drop_test.js"></script> | |
| <style> | |
| #ans_container { | |
| width: 400px; | |
| height: 400px; | |
| border: 1px solid gray; | |
| background-color: #CDFFFF; | |
| overflow: hidden; | |
| } | |
| #container { | |
| width: 300px; | |
| height: 200px; | |
| border: 1px solid gray; | |
| background-color: #0093FF; | |
| } | |
| #draggable { | |
| width:100px; | |
| height:100px; | |
| background-color: #D9FF57; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="ans_container"> | |
| <div id="container"> | |
| </div> | |
| </div> | |
| <div id="draggable"> | |
| </div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| $('#draggable').draggable(); | |
| $('#ans_container').droppable({ | |
| drop:function() { | |
| //always called here | |
| alert('ans container'); | |
| } | |
| }); | |
| $('#container').droppable({ | |
| drop:function() { | |
| //never called | |
| alert('container'); | |
| } | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| $('#draggable').draggable(); | |
| $('#container').droppable({ | |
| drop:function() { | |
| alert('container'); | |
| } | |
| }); | |
| $('#ans_container').droppable({ | |
| drop:function() { | |
| alert('ans container'); | |
| } | |
| }); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wrote blog post about this bug
http://blog.ryan5500.com/2010/04/21/jquery-uidroppabledroppable%E3%81%AE%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E9%A0%86%E7%95%AA%E3%81%AB%E6%B3%A8%E6%84%8F/