Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is the distance from the mouse pointer to the $item being dragged calculated? #164

Open
achaffman opened this issue Jan 26, 2015 · 4 comments

Comments

@achaffman
Copy link

The reason I ask is looking at the attached pic, you'll see the mouse cursor, a move cursor and the LI item (wrapped with a dotted border). That Top/Left distance is exactly the Top/Left distance from the DIV class=section to the DIV class=row inside the LI.

Should I be using an itemPath, ContainerPath, both? I'm just unclear. Any help would be appreciated.

Here is the basic code layout:

<div class="section">
  <div class="row">
    <div class="tab-content">
      <div class="tab-pane">
        <ol class="mycourselist">
          <li>
            <div class="row">
              <div class="icon-move"><span class="glyphicon glyphicon-move"></div>
              <div>col 2</div>
              <div>col3</div>
              <div>col4</div>
            </li>
           </ol>
         </div>
       </div> 
     </div>
   </div>
 </div>  

image

@olance
Copy link

olance commented Mar 24, 2015

hey, have you figured this out?! thanks!

@achaffman
Copy link
Author

No I haven’t figured this out. I am intending on switching to http://rubaxa.github.io/Sortable/ when I have time to.

@olance
Copy link

olance commented Mar 24, 2015

Okay! Thanks for replying :)

​In case it could help you or others, I have found the source of my problem (which had the same result as yours): the "dragged" class which is set in the item being dragged adds a "position: absolute" rule but it is not "important", so it was overwritten by my own CSS rules that declared a "position: relative".

​I specified that those items with the "dragged" class should instead be absolutely positioned and that made the trick!

@olance
Copy link

olance commented Mar 25, 2015

@achaffman thanks for the pointer to the other lib though, just used it and it's awesomely simple! Fixed all my problems in a matter of minutes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants