Search Results

Search found 352 results on 15 pages for 'draggable'.

Page 1/15 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • grouping draggable objects with jquery-ui draggable

    - by Jim Robert
    Hello, I want to use jquery draggable/droppable to let the user select a group of objects (each one has a checkbox in the corner) and then drag all the selected objects as a group... I can't figure out for the life of me how to do it haha. Here is what I'm thinking will lead to a usable solution, on each draggable object, use the start() event and somehow grab all the other selected objects and add them to the selection I was also considering just making the dragged object look like a group of objects (they're images, so a pile of photos maybe) for performance reasons. I think using the draggable functionality might fall over if you drag several dozen objects at once, does that sound like a better idea?

    Read the article

  • jquery ui draggable elements not 'draggable' outside of scrolling div

    - by Stu
    hello all, i am super stumped. i have many elements (floating href tags) in a div with a set height/width, with scroll set to "overflow: auto" in the css. this is the structure of the divs: <div id="tagFun_div_main"> <div id="tf_div_tagsReturn"> <!-- all the draggable elements go in here, the parent div scolls --> </div> <div id=" tf_div_tagsDrop"> <div id="tf_dropBox"></div> </div></div> the parent div's, 'tf_div_tagsReturn' and 'tf_div_tagsDrop' will ultimately float next to each other. here is the jquery which is run after all of the 'draggable' elements have been created with class name 'tag_cell', : $(function() { $(".tag_cell").draggable({ revert: 'invalid', scroll: false, containment: '#tagFun_div_main' }); $("#tf_dropBox").droppable({ accept: '.tag_cell', hoverClass: 'tf_dropBox_hover', activeClass: 'tf_dropBox_active', drop: function(event, ui) { GLOBAL_ary_tf_tags.push(ui.draggable.html()); tagFun_reload(); } }); }); as i stated above, the draggable elements are draggable within div 'tf_div_tagsReturn', but they do not visually drag outside of that parent div. worthy to note, if i am dragging one of the draggable elements, and move the mouse over the droppable div, with id 'tf_dropBox', then the hoverclass is fired, i just can't see the draggable element any more. thank you very much for any advice on helping me find a solution. this is my first run at using jquery, so hopefully i am just missing something super obvious. i've been reading the documentation and searching forums thus far to no prevail :( thank you for your time. UPDATE: many thanks to Jabes88 for providing the solution which allowed me to achieve the functionality i was looking for, here is what my jquery ended up looking like, feel free to critique it, as i am new to jquery. $(function() { $(".tag_cell").draggable({ revert: 'invalid', scroll: false, containment: '#tagFun_div_main', helper: 'clone', start : function() { this.style.display="none"; }, stop: function() { this.style.display=""; } }); $(".tf_dropBox").droppable({ accept: '.tag_cell', hoverClass: 'tf_dropBox_hover', activeClass: 'tf_dropBox_active', drop: function(event, ui) { GLOBAL_ary_tf_tags.push(ui.draggable.html()); tagFun_reload(); } }); });

    Read the article

  • Using jQuery, setting Draggable on an element prevents blur from firing when you click the draggable

    - by Danno
    Using jQuery, when you set a blur event on a text box and set another element as draggable, when you click the draggable element, the blur event does not fire in FireFox. IE is a little better, you get the blur event but you don't get the click event on the draggable element. If you don't specify the cancel: "" in the draggable constructor, you will get the blur event to fire, but then the element you want to drag is not draggable. jQuery v1.3.2 jQuery UI v1.7.2 The console.log lines are for FireFox's FireBug plugin. <HTML> <HEAD> <TITLE>Blur/Click Workbench</TITLE> <script src="js/jquery.js" type="text/javascript" ></script> <script src="js/ui/ui.core.js" type="text/javascript"></script> <script src="js/ui/ui.draggable.js" type="text/javascript"></script> <script type="text/javascript"> function blurring() { console.log('1 - blurring - ' + $( this ).attr('id')); } function clicking() { console.log('2 - clicking - ' + $( this ).attr('id')); } $(document).ready(function() { $( ".draggableTool" ).draggable( { cancel: "" } ); $( '.property' ).blur( blurring ); $( '#labelContainer' ).click( clicking ); }); </script> </HEAD> <BODY> <input type='text' class='property' id='tb1' /> <br /> <input type='text' class='property' id='tb2' /> <br /> <label class='draggableTool' id='labelContainer' style='height:20px;position:absolute;'> <textarea id='taLabel' style='height:100%;background-color:white;border:1px solid grey;'>Label</textarea> </label> </BODY> </HTML>

    Read the article

  • How do I force jquery to center an element when it snaps to another container using the draggable method?

    - by David
    Here's my script. I want some square-shaped draggable objects (in this case just td boxes with numbers in them) to be able to snap to some empty table cells and snap to the center of those cells (empty td boxes), not the top or bottom of those cells, which is what is seems to do by default. <script type="text/javascript"> $(document).ready(function () { $(".inputs div").draggable( { snap: ".spaces" } ); }); </script>

    Read the article

  • Get attribute of JQuery ui.draggable

    - by Jon
    Hi Everyone, I'm using JqueryUI for drag and drop on one of my pages and for some reason I can't seem to get an attribute of the ui.draggable object being passed into my droppable drop event. ui.draggable.attr("src") and $(ui.draggable).attr("src") both return undefined, however if I type ui.draggable.html() I will get the html back. Any ideas?

    Read the article

  • jQuery draggable leaving cloned html behind

    - by Alex Crooks
    I am using jQuery UI; Draggable http://jqueryui.com/demos/draggable invoked like this: $(document).ready(function(){ $("#side_bar").sortable({ revert: true }); $(".draggable").draggable({ containment: 'parent', hascroll: true, handle: 'div.box_header', scrollSensitivity: 100, scrollSpeed: 100, axis: 'y', connectToSortable: '#side_bar', helper: 'clone', opacity: 0.35 }); }); You can see the html structure on http://www.sarsclan.co.uk (right side bar area). It seems to create a transparant clone as your dragging, but when you drop it puts the draggable div in the right place, but leaves the original div in it's place and just appends the dom with a clone of that original div in its new place.

    Read the article

  • jquery-ui .draggable is not a function error

    - by niczoom
    I am getting the following error (using Firefox 3.5.9): $("#dragMe_" + myCount).draggable is not a function $("#dragMe_"+myCount).draggable({ containment: 'parent', axis: 'y' }); Line 231 http://www.liamharding.com/pgi/pgi.php Link to page in question : http://www.liamharding.com/pgi/pgi.php For example, click the 2 checkbox's 'R25 + R50 Random Walk' then click Show/Refresh Graphs. Two graphs should be displayed, both with draggable thin horizontal red lines. Re-open the options panel and de-select R50 Random Walk, now click Show/Refresh Graphs again, 1 graph is removed and the other updated; now re-select R50 Random Walk and click Show/Refresh, you will find the still checked R25 graph gets updated ok the above error occurs and i cant figure out why. Initially, when displaying the first 2 graphs it uses the same code and it works just fine. The error occurs on this line: //********* ERROR OCCURS HERE ********** $("#dragMe_"+myCount).draggable({ containment: 'parent', axis: 'y' }); Here is the code for the Show/Refresh Graphs.click() event: $("#btnShowGraphs").click(function(){ // Hide 'Options' panel (only if open AND an index is checked) if (IsOptionsPanelOpen && ($("#indexCheck:checked").length != 0)) {$('#optionImgDiv').click();}; var myCount = 0; var divIsNew = false; var gif_loader_small = '<div id="gif_loader_small"></div>'; var gif_loader_big = '<div id="gif_loader_big"></div>'; $("input:checkbox[id=indexCheck]").each(function() { if (this.checked) { // check for an existing wrapper div for the current forex item, using the current checkbox value (foxex name) if ( $("#"+this.value).length == 0 ) { console.log("New 'graphContainer' div : "+this.value); divIsNew = true; // Create new divs for graph image, drag bar and heading var $structure = " \ <li id=\""+this.value+"\" class=\"graphContainer\"> \ <div id=\"dragMe_"+myCount+"\" class=\"dragMe\"></div> \ <div id=\"image_"+myCount+"\" class=\"image\"></div> \ <div id=\"heading_"+myCount+"\" class=\"heading\"></div> \ </li> \ "; $('#graphResults').append($structure); // Hide dragMe DIV $('#dragMe_'+myCount).hide(); // Make 'dragMe' draggable div //********* ERROR OCCURS HERE ********** $("#dragMe_"+myCount).draggable({ containment: 'parent', axis: 'y' }); } // Display small loading gif $(gif_loader_small).clone().appendTo( $(this).parent() ); // Display large circular loading gif var $loader = $(gif_loader_big); // add temporary css attributes onto existing graph divs as they need to be displayed diffrently if(!divIsNew){ console.log("Reposition existing 'gif_loader_big' div"); $loader = $(gif_loader_big).css({ "position" : "absolute", "top" : "35%", "opacity" : ".85"}); } // add newly styled big-loader-gif to index div $loader.clone().prependTo( $("#"+this.value) ); // Call function to fetch image using ajax get_graph(this, myCount, divIsNew); } else { // REMOVE 'graphContainer' DIVS NOT CHECKED // check for div existance if ( $("#"+this.value).length != 0 ) { console.log("DESTROY: #dragMe_"+myCount+", REMOVE: #"+this.value); // DESTROY draggable //$("#dragMe_"+myCount).draggable("destroy"); // remove div $("#"+this.value).remove(); } } // reset counters and other variables myCount++; divIsNew = false; console.log("Complete: "+this.value+", NEXT index"); }); });

    Read the article

  • Jquery draggable persistence either through mysql or saving cookie in the database?

    - by Muhammad Jehanzaib
    I want to know that how can I persist the divs dropped on a draggable. I have been trying since long but stuck at this point. Actually you can see the demo here. I have to save the user designed wedding floor. So whenever user logins next time he/ she is able to see the last design saved. The code is shown below: $(document).ready(function() { $("#droppable").droppable({ accept: '.draggable', drop: function(event, ui) { $(this).append($(ui.draggable).clone()); $("#droppable .draggable").addClass("objects"); $(".objects").removeClass("ui-draggable draggable"); $(".objects").draggable({ containment: 'parent', }); } }); $(".draggable").draggable({ helper: 'clone', tolerance: 'touch', cursor:'move' }); });

    Read the article

  • HOW TO: Draggable legend in matplotlib

    - by Adam Fraser
    QUESTION: I'm drawing a legend on an axes object in matplotlib but the default positioning which claims to place it in a smart place doesn't seem to work. Ideally, I'd like to have the legend be draggable by the user. How can this be done? SOLUTION: Well, I found bits and pieces of the solution scattered among mailing lists. I've come up with a nice modular chunk of code that you can drop in and use... here it is: class DraggableLegend: def __init__(self, legend): self.legend = legend self.gotLegend = False legend.figure.canvas.mpl_connect('motion_notify_event', self.on_motion) legend.figure.canvas.mpl_connect('pick_event', self.on_pick) legend.figure.canvas.mpl_connect('button_release_event', self.on_release) legend.set_picker(self.my_legend_picker) def on_motion(self, evt): if self.gotLegend: dx = evt.x - self.mouse_x dy = evt.y - self.mouse_y loc_in_canvas = self.legend_x + dx, self.legend_y + dy loc_in_norm_axes = self.legend.parent.transAxes.inverted().transform_point(loc_in_canvas) self.legend._loc = tuple(loc_in_norm_axes) self.legend.figure.canvas.draw() def my_legend_picker(self, legend, evt): return self.legend.legendPatch.contains(evt) def on_pick(self, evt): if evt.artist == self.legend: bbox = self.legend.get_window_extent() self.mouse_x = evt.mouseevent.x self.mouse_y = evt.mouseevent.y self.legend_x = bbox.xmin self.legend_y = bbox.ymin self.gotLegend = 1 def on_release(self, event): if self.gotLegend: self.gotLegend = False ...and in your code... def draw(self): ax = self.figure.add_subplot(111) scatter = ax.scatter(np.random.randn(100), np.random.randn(100)) legend = DraggableLegend(ax.legend()) I emailed the Matplotlib-users group and John Hunter was kind enough to add my solution it to SVN HEAD. On Thu, Jan 28, 2010 at 3:02 PM, Adam Fraser wrote: I thought I'd share a solution to the draggable legend problem since it took me forever to assimilate all the scattered knowledge on the mailing lists... Cool -- nice example. I added the code to legend.py. Now you can do leg = ax.legend() leg.draggable() to enable draggable mode. You can repeatedly call this func to toggle the draggable state. I hope this is helpful to people working with matplotlib.

    Read the article

  • Saving JQuery Draggable Sitemap Values Correctly

    - by mdolon
    I am trying to implement Boagworld's Sitemap tutorial, however I am running into difficulty trying to correctly save the child/parent relationships. The HTML is as follows, however populated with other items as well: <input type="hidden" name="sitemap-order" id="sitemap-order" value="" /> <ul id=”sitemap”> <li id="1"> <dl> <dt><a href=”#”>expand/collapse</a> <a href=”#”>Page Title</a></dt> <dd>Text Page</dd> <dd>Published</dd> <dd><a href=”#”>delete</a></dd> </dl> <ul><!–child pages–></ul> </li> </ul> And here is the JQuery code: $('#sitemap li').prepend('<div class="dropzone"></div>'); $('#sitemap li').draggable({ handle: ' > dl', opacity: .8, addClasses: false, helper: 'clone', zIndex: 100 }); var order = ""; $('#sitemap dl, #sitemap .dropzone').droppable({ accept: '#sitemap li', tolerance: 'pointer', drop: function(e, ui) { var li = $(this).parent(); var child = !$(this).hasClass('dropzone'); //If this is our first child, we'll need a ul to drop into. if (child && li.children('ul').length == 0) { li.append('<ul/>'); } //ui.draggable is our reference to the item that's been dragged. if (child) { li.children('ul').append(ui.draggable); }else { li.before(ui.draggable); } //reset our background colours. li.find('dl,.dropzone').css({ backgroundColor: '', backgroundColor: '' }); li.find('.dropzone').css({ height: '8px', margin: '0' }); // THE PROBLEM: var parentid = $(this).parent().attr('id'); menuorder += ui.draggable.attr('id')+'=>'+parentid+','; $("#sitemap-order").val(order); }, over: function() { $(this).filter('dl').css({ backgroundColor: '#ccc' }); $(this).filter('.dropzone').css({ backgroundColor: '#aaa', height: '30px', margin: '5px 0'}); }, out: function() { $(this).filter('dl').css({ backgroundColor: '' }); $(this).filter('.dropzone').css({ backgroundColor: '', height: '8px', margin: '0' }); } }); When moving items into the top-level (without parents), the parentid value I get is of the first list item (the parent container), so I can never remove the parent value and have a top-level item. Is there a no-brainer answer that I'm just not seeing right now? Any help is appreciated.

    Read the article

  • jQuery UI Draggable-Droppable overflow:visible

    - by Jeff
    Sadly, I am unable to provide any JSFiddle for this issue, as I cant seem to reproduce it outside my project. I have a container where there are some boxes, that can be arranged using drag and drop, by utilizing jQuery UI. The problem is, that the container is overflow:auto; but it needs to be overflow:visible;, but if I do that, jQuery UI malfunctions. When a box drag is initiated, it will immediatly jump up aproximately 400-500px. This is how the draggable is created: $(".draggable").draggable({ revert: 'invalid', // when not dropped, the item will revert back to its initial position containment: '#editContainer', // stick to demo-frame if present helper: 'original', cursor: 'move' }); Is this a bug with jQuery UI, or can this be fixed on my end? I apologize for the lack of source code.

    Read the article

  • jQuery UI - Draggable is not a function?

    - by Dan
    Hi, I've trying to use the draggable effect on some divs on a page, but whenever I load the page, I get the error message: Error: $(".draggable").draggable is not a function I've had a look around it seemed other people were having this problem as they had not included the jQuery UI javascript file, but I definitely have. The following is within the head tag of my page: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> Can anyone suggest a solution? Any advice appreciated. Thanks.

    Read the article

  • JQUERY-UI Draggables - Seralize is running before the Draggable is complete

    - by nobosh
    Hello, I'm using the JQUERY-UI draggable plugin. As a setting, when the Draggable is done, using the STOP setting I run a function to seralize a list of LIs to get their order in terms of their IDs. For example, if I have an UL, with a list of LIs with the following IDs: 1,2,3,4,5 If I then move 5, between 2&3, the seralize is returning: 1,2,5,3,4,5 Which makes me think that the JQUERY UI-Draggable STOP is running before the page is finished rendering, or the DOM isn't update? Any ideas on how I can fix this from happening. Is there something I can do in my Seralize funtion to say, wait till JQUERY animations are all done, or stop all that are going on to ensure the DOM is accurate? Thanks

    Read the article

  • Scriptaculous Draggable/Droppable script not working properly when dragging into a scrolling div

    - by George
    I am using the Scriptaculous Draggable/Droppable scripts and have a problem when dragging into a scrolling div. I have the following layout (based on this question): #grid-container { left:33px; position:relative; width:300px; } #grid { width:310px; height:400px; overflow:auto; margin-bottom: 15px; } #grid-container ul { width:400px; list-style-type:none; white-space: nowrap; } #grid-container li { display:inline; list-style-type:none; padding:5px 15px 5px 15px; height:88px; text-align:center } .image-row { margin-left: 10px; } .grid-image { height:50px; margin-left:-20px; } Here is the html: <div id="grid-container"> <div id="grid"> <div id="row1" class="image-row"> <ul> <li><img id="img1" class="grid-image" src="images/img1.jpg"></li> <li><img id="img2" class="grid-image" src="images/img2.jpg"></li> <li><img id="img3" class="grid-image" src="images/img3.jpg"></li> <li><img id="img4" class="grid-image" src="images/img4.jpg"></li> </ul> </div> <div id="row2" class="image-row"> <ul> <li><img id="img5" class="grid-image" src="images/img5.jpg"></li> <li><img id="img6" class="grid-image" src="images/img6.jpg"></li> </ul> </div> </div> </div> I have another div with draggable items, while all of the img elements are droppable. This works very well for most cases, but when there are too many images for the grid and it has to scroll, I run into issues. I can still drag/drop into most items in that div, but when I scroll down and then try to drag onto an item in the bottom of the list, it drops on the row that was at the bottom before I scrolled the div. Even if I set the scroll attribute when creating the Draggable items, it will scroll the grid div, but not use the proper Droppable item. Is there any way to make the Draggable items drop onto the proper Droppable element regardless of if the containing div is scrolled or not?

    Read the article

  • draggable out the parent element

    - by Luca Romagnoli
    Hi i have 2 div <div style="width:50px;height:100px;overflow:auto" id="outer"> <div class="kind_div">hello</div> </div> i tried the draggable function of jquery ui: $("div.kind_div").draggable({ cursor: 'crosshair', containment: 'document', appendTo: 'body' }); i can drag the kind_div but it remains into the outer div I want drag it in all body of my page how can i do? thanks

    Read the article

  • Problems with jQuery .not() and the draggable ui

    - by Chris
    Okay, when something is draggable, it is given the class .ui-draggable And when something is disabled from being draggable .ui-draggable-disabled I want to select only items that are draggable. I'm using the following selector, but it doesn't seem to work. My disabled draggable items are still doing something on hover. Any ideas why? $('.ui-draggable').not('.ui-draggable-disabled').hover(function() { // rest of code Thanks

    Read the article

  • 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

  • How can I make a jQuery UI 'draggable()' div draggable for touchscreen?

    - by artlung
    I have a jQuery UI draggable() that works in Firefox and Chrome. The user interface concept is basically click to create a "post-it" type item. Basically, I click or tap on div#everything (100% high and wide) that listens for clicks, and an input textarea displays. You add text, and then when you're done it saves it. You can drag this element around. That is working on normal browsers, but on an iPad I can test with I can't drag the items around. If I touch to select (it then dims slightly), I can't then drag it. It won't drag left or right at all. I can drag up or down, but I'm not dragging the individual div, I'm dragging the whole webpage. So here's the code I use to capture clicks: $('#everything').bind('click', function(e){ var elem = document.createElement('DIV'); STATE.top = e.pageY; STATE.left = e.pageX; var e = $(elem).css({ top: STATE.top, left: STATE.left }).html('<textarea></textarea>') .addClass('instance') .bind('click', function(event){ return false; }); $(this).append(e); }); And here's the code I use to "save" the note and turn the input div into just a display div: $('textarea').live('mouseleave', function(){ var val = jQuery.trim($(this).val()); STATE.content = val; if (val == '') { $(this).parent().remove(); } else { var div = $(this).parent(); div.text(val).css({ height: '30px' }); STATE.height = 30; if ( div.width() !== div[0].clientWidth || div.height () !== div[0].clientHeight ) { while (div.width() !== div[0].clientWidth || div.height () !== div[0].clientHeight) { var h = div.height() + 10; STATE.height = h; div.css({ height: (h) + 'px' }); // element just got scrollbars } } STATE.guid = uniqueID() div.addClass('savedNote').attr('id', STATE.guid).draggable({ stop: function() { var offset = $(this).offset(); STATE.guid = $(this).attr('id'); STATE.top = offset.top; STATE.left = offset.left; STATE.content = $(this).text(); STATE.height = $(this).height(); STATE.save(); } }); STATE.save(); $(this).remove(); } }); And I have this code when I load the page for saved notes: $('.savedNote').draggable({ stop: function() { STATE.guid = $(this).attr('id'); var offset = $(this).offset(); STATE.top = offset.top; STATE.left = offset.left; STATE.content = $(this).text(); STATE.height = $(this).height(); STATE.save(); } }); My STATE object handles saving the notes. Onload, this is the whole html body: <body> <div id="everything"></div> <div class="instance savedNote" id="iddd1b0969-c634-8876-75a9-b274ff87186b" style="top:134px;left:715px;height:30px;">Whatever dude</div> <div class="instance savedNote" id="id8a129f06-7d0c-3cb3-9212-0f38a8445700" style="top:131px;left:347px;height:30px;">Appointment 11:45am</div> <div class="instance savedNote" id="ide92e3d13-afe8-79d7-bc03-818d4c7a471f" style="top:144px;left:65px;height:80px;">What do you think of a board where you can add writing as much as possible?</div> <div class="instance savedNote" id="idef7fe420-4c19-cfec-36b6-272f1e9b5df5" style="top:301px;left:534px;height:30px;">This was submitted</div> <div class="instance savedNote" id="id93b3b56f-5e23-1bd1-ddc1-9be41f1efb44" style="top:390px;left:217px;height:30px;">Hello world from iPad.</div> </body> So, my question is really: how can I make this work better on iPad? I'm not set on jQuery UI, I'm wondering if this is something I'm doing wrong with jQuery UI, or jQuery, or whether there may be better frameworks for doing cross-platform/backward compatible draggable() elements that will work for touchscreen UIs. More general comments about how to write UI components like this would be welcome as well. Thanks!

    Read the article

  • How to get jQuery draggable elements scroll with mb.imageNavigator

    - by bulltorious
    I am using jQuery mb.imageNavigator (1.8) from http://pupunzi.open-lab.com/mb-jquery-components/mb-imagenavigator/ to implements a Risk type game adjucation system. Using the imageNavigator plugin I am able to scroll around a large game map of the world. My issue is when I declare some elements as draggable and drag them onto the map image, their location does not stay relative to where in the picture I put them. They just stay fixed on the screen no matter where I scroll. Does anyone know how to make the the draggable elements scroll with the image? Matteo posts about "you can add an additional content layer that overlay image and moves with it" and posts an example, but I can't make it work. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ` <head> <script type="text/jscript" src="lib/jquery/jquery-1.3.2.js"> </script> <script type="text/jscript" src="lib/jquery/jquery-ui-1.7.2.custom.min.js"> </script> <script type="text/jscript" src="lib/utilities/mbImgNav.min.js_0.js"> </script> <script type="text/jscript" src="lib/utilities/start.js"> </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>New Web Project</title> </head> <body> <div id="AdamsAshTray" style="float:right; background-color:red; z-index:999"> test test test </div> <div id="navArea"> <div imageUrl="someimage" navPosition="BR" navWidth="100" style="display:none;" class="imagesContainer"> <span class="title">zuccheriera</span> <div class="description"> <STRONG>description1</STRONG> </div> </div> </div> </body> $(document).ready(function(){ $("#navArea").imageNavigator({ areaWidth:1820, areaHeight:1000, draggerStyle: "1px dotted red", navOpacity: .8 }) $("#AdamsAshTray").draggable({ grid: [20,20] }); })`

    Read the article

  • How to create a draggable overlayItem in Android 2.1

    - by Zap
    Does anyone know how to make a map overlayitem draggable so I can press and hold it and drag it across the map. I am trying to duplicate the draggable icon behavior that's available on the iPhone. One developer suggested a possible solution is to detect a touch event, get rid of the existing overlay item, draw your own copy of the icon where the overlay item had been, manually animate that as the user drags, and then put the overlay item where the user drops it (getting rid of your manually-drawn icon). Does anyone have sample java code to do this Android 2.1? This would be much appreciated.

    Read the article

  • Make jQuery-ui draggable handle cover entire page

    - by Acorn
    What would be the best way to make an element draggable when clicking anywhere in the window? Would I have to use a container <div> that covers the whole window? I tried making the body draggable but that didn't work. The problem with using a container <div> is that it moves and therefore doesn't cover the whole of the screen any more after it has been dragged. What about making a really vast container <div> that spans a large number of pixels in every direction so you would never get to the edge of it. Is that a bad idea? The idea (simplified) is to have a page with a square in the middle that can be dragged by dragging any part of the window. Here's a wonderfully unnecessary mockup :)

    Read the article

  • jquery draggable into sortable only works after sorting

    - by Dao
    Hi, I'm experiencing problems with a simple combination of a Draggable and Sortable: initially, the dragging does not work and I do not get a receive callback. Only after I have done a sort (i.e. change the position of things in #workarea), can I drag new things into it. Somehow it seems as if the sortable needs to be 'initialized' before it accepts draggables. My code, in a simplified version: $(".element_draggable").draggable({ zIndex: 2, helper: 'clone', connectToSortable: '#workarea'}); $("#workarea").sortable({ receive: function() {alert('received');} }); Does anyone have an idea on what I could be doing wrong here?

    Read the article

  • jeditable accidentally triggering on Draggable on nested items

    - by ripper234
    I'm using jquery-ui's draggable for drag-and-drop, and jeditable for inline editing. When I drag and drop an element that's also editable, right after it's dropped jeditable kicks in and pops into 'edit mode'. How can I disable this behavior? Edit - the problem happens because of netsting - see this example. I also added draggable to the mix to make the example more realistic (the actual real problem is in this site that I'm working on) Note - even though this question has an accepted answer because of the bounty rules, the problem is still not resolved for me.

    Read the article

  • JQuery/JavaScript confusion with Previous and Next buttons.

    - by Anders H
    I've got some inherited JQuery code that isn't working as I'd think and I'm just not even sure what to research or look up next. The Problem: I've got a few DIVs within the HTML: a container, a "frame" and the content. If the content is longer than the frame, it's cut off using overflow:hidden and a Next - button appears. The next button works correctly. However, there's also a previous button with similar code, but it does not work as expected and just displays whenever the next button does. Whenever either button is hidden, it will not reappear again when navigating back through the "pages". When the I may be overlooking something in the code, but here it is in full. The HTML: <div id="draggable" class="ui-widget-content"> <div id="draggable-title" class="cufon">about</div> <a id="draggable-close" href="javascript:void(0);"><div class="close-img icon"></div></a> <div class="clear"></div> <div id="draggable-frame"> <div id="draggable-content"> </div> </div> <a id="prevContent" href="javascript:void(0);">&laquo; previous</a><a id="nextContent" href="javascript:void(0);">next &raquo;</a> </div> The JavaScript: $(function() { $("#draggable").draggable(); }); $(document).ready(function(){ $("#draggable-frame").scrollTop(0); $("#prevContent").click(function(){ $("#draggable-content").fadeOut("medium"); setTimeout("showPrev()", 250); if($("#draggable-frame").scrollTop()+$("#draggable-frame").height() >= $("#draggable-content").height()) { $("#prevContent").hide(); } $("#draggable-content").fadeIn("medium"); }); $("#nextContent").click(function(){ $("#draggable-content").fadeOut("medium"); setTimeout("showNext()", 250); if($("#draggable-frame").scrollTop()+$("#draggable-frame").height() >= $("#draggable-content").height()) { $("#nextContent").hide(); } $("#draggable-content").fadeIn("medium"); }); $("#draggable-close").click(function(){ $("#draggable").fadeOut("medium"); }); $("#prevContent").hide(); $("#nextContent").hide(); showContent("about"); $(".opener").click(function(){ $("#draggable-frame").scrollTop(0); $("#draggable").fadeIn("medium"); showContent($(this).attr("title")); }); }); // function showPrev() { $("#draggable-frame").scrollTop($("#draggable-frame").scrollTop() - $("#draggable-frame").height()); } // function showNext() { $("#draggable-frame").scrollTop($("#draggable-frame").scrollTop() + $("#draggable-frame").height()); } function showContent(title) { $("#draggable-title").html(title); $("#draggable-content").html($("#"+title).html()); Cufon.replace('.cufon', { fontFamily: 'cav', hover: true }); $("#nextContent").hide(); $("#prevContent").hide(); if($("#draggable-content").height() > $("#draggable-frame").height()) { $("#nextContent").show(); } if($("#draggable-content").height() > $("#draggable-frame").height()) { $("#prevContent").show(); } } Even just point me in the right direction to research would be a big help right now. Thank you.

    Read the article

  • jQuery draggable removing without changing position of other elements

    - by Yurish
    Hi! I am building a page layout configuration system on jQuery. So everyone, who is using my website can make it personal by moving elements on webpage. But, I have a problem. Every element on my page is a draggable div with option to be removed from page if necessary. When user wants to remove an element, he clicks on inner div and the following function is called: <script language="javascript"> $(function() { $('.close').click(function(){ $(this).parent().hide(); }); }); </script> <div class="main"><div class="close"></div></div> When user wants to add an element on page, he clicks on link and followinf function is called: function addNewWidget(page_name, size){ var page = $('#'+page_name); var closeDiv = $(document.createElement("div")).attr("class", "close").html('X'); closeDiv.click(function(){ $(this).parent().hide(); }); var div = $(document.createElement("div")) div.attr("class", "drag"); div.appendTo(page); closeDiv.appendTo(div); div.draggable({ containment: "#page", scroll: false, grid: [200, 200] }); div.css("top:0; left:0"); div.addClass(size); div.addClass('widget'); } Everything works fine, but when element is removed, other elements, which were on page are moving up. It is because of element positioning in the code. These divs in the code are before div, which was removed, and their absolute top is changed by -heghtOfRemovedElement Is there any way to prevent other elements from moving up?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >