Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('#dragThis').resizable({
- stop: function(event, ui) {
- var w = $(this).width();
- var h = $(this).height();
- var tr = $('#contentDiv');
- tr.each(function() {
- //alert( fields[$(this).index()] )
- $(this).height(h - 45);
- });
- console.log('StopEvent fired')
- console.log('Width:' + w);
- console.log('Height:' + h)
- }
- }).draggable(
- {
- containment: $('body'),
- drag: function() {
- var offset = $(this).offset();
- var offsetImage = $("#<%=dropHere.ClientID %>").offset();
- var xPos = offset.left;
- var yPos = offset.top;
- $('#posX').text('x: ' + xPos);
- $('#posY').text('y: ' + yPos);
- },
- stop: function() {
- var finalOffset = $(this).offset();
- var finalxPos = finalOffset.left;
- var finalyPos = finalOffset.top;
- $('#finalX').text('Final X: ' + finalxPos);
- $('#finalY').text('Final X: ' + finalyPos);
- }
- });
- <div class="dragThis" id="dragThis">
- <div class="content" id="contentDiv">
- <p>
- <asp:Label ID="lblContent" Width="2px" runat="server" Text="Label"></asp:Label>
- </p>
- </div>
- <div class="pointer">
- <div class="one">
- </div>
- <div class="two">
- </div>
- </div>
- </div>
- $('#dragThis').resizable('destroy').draggable('destroy');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement