Solved

JQuery draggable helper

Posted on 2013-11-19
4
296 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn how to dynamically set the form action using jQuery.

896 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now