Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JQuery draggable helper

Posted on 2013-11-19
4
Medium Priority
?
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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 Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 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