Created
April 22, 2019 14:39
-
-
Save akhileshdarjee/580a452872fb28b439e6085353f0e2b8 to your computer and use it in GitHub Desktop.
Set width and height while dragging object in jquery
This file contains 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
$('body').find('.draggable').draggable({ | |
revert: true, | |
revertDuration: 0, | |
stack: ".draggable", | |
helper: 'clone', | |
start: function(event, ui) { | |
$(ui.helper).removeAttr('width'); | |
$(ui.helper).removeAttr('height'); | |
var ele_width = $('body').find('.square').width(); | |
var ele_height = $('body').find('.square').height(); | |
$(ui.helper).width(ele_width).height(ele_height); | |
// you can also use static values | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment