Search and Top Navigation
#4747 closed bug (notabug)
Opened August 04, 2009 05:14PM UTC
Closed August 06, 2009 02:30PM UTC
Last modified October 11, 2012 09:15PM UTC
containment-restriction not work for contained div bigger then containers with overflow:hidden
Reported by: | Deneb87 | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ui.draggable | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
containment-restriction not work for contained div bigger then containers with overflow:hidden
<!doctype html> <html lang="en"> <head> <script type="text/javascript" src="jquery-1.3.2.js"></script> <script type="text/javascript" src="ui.core.js"></script> <script type="text/javascript" src="ui.draggable.js"></script> <style type="text/css"> .draggable { width: 800px; height: 570px; padding: 0; float: left; margin: 0; background-image:url('image800x570.png')} #draggable { border:0; } #containment-wrapper { width: 500px; height:250px; border:2px solid #ccc; padding: 0; overflow:hidden } </style> <script type="text/javascript"> $(function() { $("#draggable").draggable({ cursor: 'pointer', containment: '#containment-wrapper', scroll: false }); }); </script> </head> <body> <div id="containment-wrapper"> <div id="draggable" class="draggable"></div> </div> </body> </html>
Attachments (0)
Change History (3)
Changed August 04, 2009 09:51PM UTC by comment:1
Changed August 06, 2009 02:30PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
Based on the functionality, and meaning, of containment it doesn't make sense to try to contain something in an element that's smaller than itself.
Changed October 11, 2012 09:15PM UTC by comment:3
milestone: | TBD |
---|
Milestone TBD deleted
solved! now u can update the script.
ui.draggable.js [start line 280]
where abxx and abyy are the difference, in px, between the draggable div and container div;
make sense only when draggable size(x,y) > container size(x,y)