drag and drop - jQuery's draggable grid -


It seems that the compiler's 'grid' option is relatively bound to the original coordinates of the element that pulls - if you have Put your drawable divaces in the Top set in relative order with your parents, respectively, with 100, 200, 254 pixels, then just enter:

  & lt ; Div class = "parent" style = "position: relative;" & gt; & Lt; Div id = "div1" class = "dragable" style = "top: 100px; condition: complete;" & Gt; & Lt; / Div & gt; & Lt; Div id = "div2" square = "drag-worthy" style = "top: 200px; condition: complete;" & Gt; & Lt; / Div & gt; & Lt; Div id = "div3" class = "drag-worthy" style = "top: 254px; condition: complete;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt;  

ADNs are being able to drag all the 'grid' sets to [1, 100]:

  draggables = $ ('draggable') ; $. (Drugs, Function (Index, AMM) {$ (AMM). Drug (Eligible): $ ('# Parent-Dev'), Opacity: 0.7, Reverse: 'Invalid', Riversdraw: 300, Grid: [ 1, 100], fresh position: true}};}); The problem here is that as soon as you drag  div3 , say, it increases to the top 100, it is  354px  46px  (254 + 46 = 300), which gets it at the next stop in the grid -  300px , if we see There are a point of reference and  parents  as a "grid holder". 

Take a look at the draggable sources and it seems to be an inherent fault - they just calculate all against the original state of the dragable element.

I would like to save from gunpoint, which is to patch the code of dragable library and how I am really searching here, how it is draggable, calculate the grid positions with the parent, though if the monkey -Patching is indispensable, so I think I'll stay with it.

I got around this problem just by dragging my script to drag: under drag and Set it to divide the math. Floor (x / 100) * 100 and same for Y.

Look at the in the source and create a dragable function! (Game not ending game)

You will also get a problem bringing it back, it has not stopped them on the grid so I wrote my own "check if invalid": Re-viewable on the game again).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -