I have a draggable div (jquery ui draggable) which contains mainly text. Can I change the contents of the div while dragging?
(actually, I want to make it a smaller and nicer div)
Try this out: http://jsfiddle.net/6JtMp/
Here's the code:
<style>
#draggable { width: 150px; height: 150px; padding: 0.5em; background-color: green; }
</style>
<script>
$(function() {
$( "#draggable" ).draggable({
start: function(event, ui) { $(this).css("height",10); },
stop: function(event, ui) { $(this).css("height",150); }
});
});
</script>
<div class="demo">
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
</div><!-- End demo -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With