Here is what I have now, look at stackoverflow everywhere and the whole solution did not work for me :( The problem is that I use draggable and resizable on some elements, etc. the pictures that are places in the container with redundant property. there is a problem with draggable, I want this object to move above the image at the top of the page, but the element always falls under the image above. The problem is that I resize first, than I can move the element on top before that changes :( Another difficult problem is Does it mean that I first resize, the second object goes beyond this element, just overlapping it?
I tried many solutions for these two fixes, but no luck. That's what I am at the moment
CSS
#zidomotac{ width:100%; } #myWorkContent{ width:100%; overflow-x: scroll; white-space: nowrap; box-sizing:border-box; margin-bottom:20px } .slikezamenjanje{ width: 100px; float:left; display: inline-block; vertical-align: middle; } .slikezamenjanje img{ max-height: 120px; overflow:hidden; width: 100%; }
EXTERNAL
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
FUNCTIONS
<script type="text/javascript"> $(document).ready(function() { $('.slikezamenjanje').draggable().resizable({ aspectRatio: 16 / 9, }); }); </script>
HTML
<div id="zidomotac"><img src="http://www.vectorimages.org/09/0920100513111825424.jpg"></div> <div id="myWorkContent"> <div class="slikezamenjanje"><img src="http://placekitten.com/200/200/"/></div> <div class="slikezamenjanje"><img src="http://placekitten.com/200/200/"/></div> </div> </div>
This is a working jsfiddle http://jsfiddle.net/gorostas/CS93M/ I hope someone finds a solution
EDITED
Maybe I can make the first call resizable and then inside draggable?
UPDATE
If I use draggable like this
$(document).ready(function() { $(".slikezamenjanje").draggable({ revert: "invalid" , helper: function(){ $copy = $(this).clone(); return $copy;}, appendTo: 'body', scroll: false }); });
I can move the item, but is the problem coming back?
jquery jquery-ui overflow draggable
Miomir dancevic
source share