Solved

JQuery draggable helper

Posted on 2013-11-19
4
300 Views
Last Modified: 2013-11-28
Hi,

I am using a helper to create a new elemnt to drag. This element is initially set to be positioned absolutely -42px from top . But, when the helper gets activated the top position gets reset to 0.

Is there a way to prevent the absolute position getting reset?

This also affects "revert". i.e when the element is not dropped on the target it reverts back to initial position,  which isnt the absolute position i set within css

Thanks
0
Comment
Question by:coolispaul
  • 2
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Alexandre Simões
ID: 39659631
But what's your idea?
top: -42px will put your element off screen, what are you trying to accomplish?
0
 

Author Comment

by:coolispaul
ID: 39659666
well, no because its positioned relative to another element.

essentially, it sits on top of another element.

I want the "helper" to maintain this position, but it goes back to its actual position on the page.

Thanks
0
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 500 total points
ID: 39659712
Well, you must be doing something wrong in your code.
Here's a working sample based on the one on the official jQuery UI website:
http://jsfiddle.net/gkPKL/

Original sample: http://jqueryui.com/droppable/#revert

I changed it a bit to try to simulate what you described but the final result was not the same as you have.
0
 

Author Comment

by:coolispaul
ID: 39659739
oh ok - thanks for that

'll try and fix based on your example

Thanks again
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS in HTML 5 51
Sending ASP to server side 8 28
window close link 7 32
arrays and radio buttons 10 36
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question