Search Results

Search found 2 results on 1 pages for '10goto10'.

Page 1/1 | 1 

  • jQuery draggable + droppable: how to snap dropped element to dropped-on element

    - by 10goto10
    I have my screen divided into two DIVs. In the left DIV I have a few 50x50 pixel DIVs, in the right DIV I have an empty grid made of 80x80 LIs. The DIVs on the left are draggable, and once dropped on a LI, they should snap to center of that LI. Sounds simple, right? I just don't know how to get this done. I tried by manipulating the dropped DIV's top and left CSS properties to match those of the LI they're dropped into, but the left and top properties are relative to the left DIV. How can I best have the dropped element snap to the center of the element it's dropped into? That's gotta be simple, right? Edit: I'm using jQuery UI 1.7.2 with jQuery 1.3.2. Edit 2: For whoever else has this problem, this is how I fixed it: I used Keith's solution of removing the dragged element and placing it inside the dropped-on element in the drop callback of the droppable plugin: function gallerySnap(droppedOn, droppedElement) { $(droppedOn).html('<div class="drop_styles">'+$(droppedElement).html()+'</div>' ); $(droppedElement).remove(); } I don't the dropped element to be draggable again, but if you do, just bind draggable to it again. For me this method also solved the problem I had when positioning the dropped elements (which would be relative to the left DIV) and scrolling inside the second DIV. (Elements would remain fixed on page, now they scroll along). I did play with the snap options to make it look good while dragging, so thanks to karim79 for that suggestion. I probably won't win any Awesome Code prizes with this, so if you see room for improvement, please share!

    Read the article

  • I work on local copies of files and upload them to a remote server on save. What version control sys

    - by 10goto10
    Here's my situation: My files are on a remote server (Linux). When I want to edit a file at home on my Windows machine, my editor (PSPad) downloads a copy. When I save the document, my editor uploads it to the server, overwriting the previous version. Is there a version control system, preferably GUI driven, that can handle this situation? Additional info: I probably can't install elaborate software on the remote server, but can on my own computer. Concurrent Versions System (CVS) is installed on the remote server. Uploading/downloading goes through an FTP-to-SFTP bridge set up with Bitvise Tunnelier.

    Read the article

1