Search Results

Search found 98 results on 4 pages for 'droppable'.

Page 1/4 | 1 2 3 4  | Next Page >

  • multiple droppable

    - by Sune
    Ive have multiple droppable divs (which all have the same size) and one draggable div. The draggable div is 3 times bigger than one droppable. When I drag the draggable div on the droppables divs I want to find which droppable has been affeckted. My code looks like this: $(function () { $(".draggable").draggable({ drag: function (event, ui) { } }); $(".droppable").droppable({ drop: function (event, ui) { alert(this.id); } }); }); the html <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div0" class="droppable"> drop in me1! </div> <div style="height:100px; width:200px; border-bottom:1px solid red;" id="Div1" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div2" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div3" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div4" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div5" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div6" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div7" class="droppable"> drop in me2! </div> <div class="draggable" id="drag" style="height:300px; width:50px; border:1px solid black;"><span>Drag</span></div> But my alert only shows the first which my draggable div (Div0) hits, how can I find the missing (Div1 and Div2), which also is affeckted?? Here's a guy with the same problem : http://forum.jquery.com/topic/drop-onto-multiple-droppable-elements-at-once

    Read the article

  • Jquery droppable live disabling/enabling

    - by Cameron
    I have a some draggables in a list of droppables (1 draggable per droppable li). When I move a draggable from one droppable to another free droppable, I want to diable the receiving droppable, and enable the droppable it is leaving from. In firebug the droppable class gets removed – but the functionality of the droppable remains. I have a feeling I need to use live() somehow, but could use a leg-up. $(function() { $(".user").draggable({ revert : true, revertDuration : 200 }); $("li.droppable").droppable({ accept : ".user", hoverClass : "drophover", drop: function(event, ui) { var position = this.getAttribute("id").replace("position_", ""), user_id = ui.draggable.attr("id").replace("user_", ""); droppable = this parent = ui.draggable.parent() $.ajax({ url : "users/"+user_id+"", type : "POST", dataType: "JSON", data : ({ "position" : position, "_method" : "PUT" }), success : function() { $(ui.draggable).parent().addClass("droppable"); $(ui.draggable).appendTo(droppable); $(parent).removeClass("droppable"); } }); } }); });

    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

  • Problem with jquery-droppable in Chrome

    - by ripper234
    I have a simple application that users jquery-ui's draggable and droppable. In Firefox, it works perfectly. In Chrome, however, I'm having problems. This is the code: $(".cell").droppable({ drop: function(event, ui) { var originalTarget = event.originalTarget; ... } }); In Chrome the 'event' object is of type 'Object' (using Chrome Dev Kit), and event.originalTarget is 'undefined'. What am I doing wrong?

    Read the article

  • Problems with JQuery's Droppable Tolerance 'fit' feature when using the same size divs

    - by Chris
    Hi I'm just wondering if anybody else can manage to get the tolerance:'fit' option to work when using the 'droppable' feature in jQuery's UI? I want to call a function only when the draggable div is dropped perfectly onto a droppable div. Both divs are the same size and I'm using snapMode:outer to help the end user. I simply cannot get it to work with 'fit'. Works perfectly with 'intersect'. Would really appreciate some help. Thanks Chris

    Read the article

  • iframe as scriptaculous droppable

    - by Nathan
    I have a sortable list and an iframe on the same page. What I'm trying to do is define the <iframe> as a Droppable. Everything works with out errors but when I try to drag a sortable item across the Iframe it stops at the edge. ( if I move it slowly it seems works in firefox) The Iframe is set to DesignMode ="on" so covering it with a transparent element to act as the droppable does not seem applicable here. Anyone know of any other solutions or a better way to handle this?

    Read the article

  • Make jQuery sortable items droppable to their peers

    - by user316727
    I have a sortable list (of tasks). It helps prioritize tasks, so I want to keep this functionality. Now I want to add subtasks to the functionality: I want to enable users to drag one task over to another task and drop it there to turn it into a subtask. Applying .draggable() and .droppable() to items that are already sortable has no effect. What could I do?

    Read the article

  • jQuery Sortable + Droppable z-index problem

    - by unknowndomain
    I am having a probelm with the z-index of my sortable object not being above my droppable. If you visit http://clareshilland.unknowndomain.co.uk/. Press Ctrl + L to bring up the login screen. Enter the username clare and the password shilland. It will then load in the admin bar and if you click manage gallery. A pop down thumbnail view will appear with all the photos from that gallery. The issue is that when you drag the 'polaroids' from the grid to the delete area they are under the delete area. I tried putting the delete area inside the same div as the grid but it makes no difference, I just don't know what to do at this point so any help would be a massive help!

    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

  • jquery droppable accept

    - by Nishima
    Hi All, Can anyone tell me how can i write a function in accept condition and then how does it finds out that what to accept and what not to accept. Fo r eg i want to accept div a and div b in accept condition.How can i write i through a function.

    Read the article

  • Jquery Drag-Drop (Getting element being dropped into)

    - by Ryan
    I am trying to detect which cell an object is being dropped into. <table> <tr> <td class="weekday">Sun</td> <td class="weekday">Mon</td> <td class="weekday">Tue</td> <td class="weekday">Wed</td> <td class="weekday">Thu</td> <td class="weekday">Fri</td> <td class="weekday">Sat</td> </tr> <tr> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> <td class="droppable">&nbsp;</td> </tr> </table> <div class="draggable">Drag Me</div> on drop, how do i determine which day the div was dropped into. thanks for any help.

    Read the article

  • jquery draggable/droppable issue

    - by Scarface
    Hey guys I have a drag and drop function that does not fully work. What I want to do is be able to drag and drop a picture into a div and have that picture pop up in the div. I have a list of 2 pictures right now, so I have the following function echoed for each picture. Both pictures are draggable and droppable, but the first one is the only one that appears in the div, regardless of which picture gets dragged in. I am not sure what is wrong because the jquery function seems to be unique to each picture. If any one has any suggestions I would appreciate it greatly. while ($row = mysql_fetch_assoc($query)) { $image=htmlentities($row['image']); //image name $uniqid=uniqid(); //unique id for jquery functions $dirname = "usercontent/$user/images/$image"; echo "<img id=\"$uniqid\" src=\"$dirname\" width=\"75\" height=\"75\"/>"; echo "<script> $(function() { $(\"#$uniqid\").draggable({ scroll: true, scrollSensitivity: 10, scrollSpeed: 10, revert: true, helper: 'clone', cursorAt: { cursor: 'move', top: 27, left: 27 } }); $(\"#droppable2, #droppable-background , #droppable2-innerer\").droppable({ greedy: true, activeClass: 'ui-state-hover', hoverClass: 'ui-state-active', drop: function(event, ui) { $(this).addClass('ui-state-highlight').find('> p').html('Dropped!'); $('#droppable-background').css(\"background-image\",\"url($dirname)\"); } }); }); </script>"; }

    Read the article

  • jQuery live draggable / live droppable?

    - by Henk
    Hi all, Basically there are two tables: Companies and visitors. Currently it's possible to drag visitors to companies. Works great. As soon as the drop function occurs, there are two $.post's. The first one saves the drag to the database. The second one updates the visitors, because the information constantly changes. The problem, however is that as soon as the second $.post finishes, Firebug keeps popping the following error: d(this).data("draggable") is null Which occurs in the jQuery UI file. On line 56. about 400 times or so. So basically I'm looking for a way to do live() with draggable and droppable. The .draggables are in #visitors (an ul). The droppables are in #companies (a table). Thanks! $(".draggable").draggable({ revert:true }); $(".droppable").droppable({ drop: function(ev, ui) { $(this).text($(ui.draggable).text()); $.post('planning/save_visit', {user_id: $(ui.draggable).attr('id'), company_id: $(this).attr('id'), period: $('ul.periods li.active').attr('id')}); $.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){ $('#visitors').html(data); }); }, hoverClass: 'drophover' });

    Read the article

  • question about jQuery droppable/draggable.

    - by FALCONSEYE
    I modified a sample photo manager application. photo manager application Instead of photos, I have employee records coming from a query. My version will let managers mark employees as on vacation, or at work. One of the things I did is to include employee ids like <a href="123">. I get the ids from event.target. This works for the click function but not for the "droppable" function. This is what I have for the click function: $('ul.gallery > li').click(function(ev) { var $item = $(this); var $unid = ev.target; var $target = $(ev.target); if ($target.is('a.ui-icon-suitcase')) { deleteImage($item,$unid); } else if ($target.is('a.ui-icon-arrowreturnthick-1-w')) { recycleImage($item,$unid); } return false; }); ev.target correctly gives the employee id. when i try the same in one of the droppable functions: $gallery.droppable({ accept: '#suitcase li', activeClass: 'custom-state-active', drop: function(ev, ui) { var $unid = ev.target; alert($unid); recycleImage(ui.draggable,$unid); } }); the alert(ui) gives me [object]. What's in this object? How do i get the href out of this? thanks

    Read the article

  • jQuery droppable accordion

    - by awshepard
    I've been playing around with trying to create a droppable accordion for a little while, and haven't gotten it to be very responsive. When I drag an item over the accordion, it takes 5+ seconds for the accordion element to open (if it does at all). Sometimes I have to "wave" the dragged element over the accordion element. I know I read something a while back about event processing in javascript - something along the lines of the browser not always passing control to the javascript engine when you think it does, or something like that, resulting in weird timing. Has anyone else seen tried to do this before? Have you found jquery/javascript to be this slow? Do you have any references for how to get a responsive droppable accordion (the jQuery UI site doesn't seem to, and I didn't find anything on SO or Google). Thanks!

    Read the article

  • specific draggable is above a specific droppable

    - by hopes
    Hi everyone, I am a begginer in JQuery and I want to make a simple matching quiz so I used this code to create the qustions div and answers div The Capital of KSA The Capital of UK The Capital of USA Riyadh London Washington I want to know after submit button is clicked if all accepted draggables are now dragged to the suitable droppables I used this code to make the answers divs draggable and to make them accepted for their questions divs $(function() { $("#a3").draggable(); $("#q3").droppable({ accept: '#a3', }); }); your help will be appreciated :)

    Read the article

  • Add Widget via Action in Toolbar

    - by Geertjan
    The question of the day comes from Vadim, who asks on the NetBeans Platform mailing list: "Looking for example showing how to add Widget to Scene, e.g. by toolbar button click." Well, the solution is very similar to this blog entry, where you see a solution provided by Jesse Glick for VisiTrend in Boston: https://blogs.oracle.com/geertjan/entry/zoom_capability Other relevant articles to read are as follows: http://netbeans.dzone.com/news/which-netbeans-platform-action http://netbeans.dzone.com/how-to-make-context-sensitive-actions Let's go through it step by step, with this result in the end, a solution involving 4 classes split (optionally, since a central feature of the NetBeans Platform is modularity) across multiple modules: The Customer object has a "name" String and the Droppable capability has a method "doDrop" which takes a Customer object: public interface Droppable {    void doDrop(Customer c);} In the TopComponent, we use "TopComponent.associateLookup" to publish an instance of "Droppable", which creates a new LabelWidget and adds it to the Scene in the TopComponent. Here's the TopComponent constructor: public CustomerCanvasTopComponent() {    initComponents();    setName(Bundle.CTL_CustomerCanvasTopComponent());    setToolTipText(Bundle.HINT_CustomerCanvasTopComponent());    final Scene scene = new Scene();    final LayerWidget layerWidget = new LayerWidget(scene);    Droppable d = new Droppable(){        @Override        public void doDrop(Customer c) {            LabelWidget customerWidget = new LabelWidget(scene, c.getTitle());            customerWidget.getActions().addAction(ActionFactory.createMoveAction());            layerWidget.addChild(customerWidget);            scene.validate();        }    };    scene.addChild(layerWidget);    jScrollPane1.setViewportView(scene.createView());    associateLookup(Lookups.singleton(d));} The Action is displayed in the toolbar and is enabled only if a Droppable is currently in the Lookup: @ActionID(        category = "Tools",        id = "org.customer.controler.AddCustomerAction")@ActionRegistration(        iconBase = "org/customer/controler/icon.png",        displayName = "#AddCustomerAction")@ActionReferences({    @ActionReference(path = "Toolbars/File", position = 300)})@NbBundle.Messages("AddCustomerAction=Add Customer")public final class AddCustomerAction implements ActionListener {    private final Droppable context;    public AddCustomerAction(Droppable droppable) {        this.context = droppable;    }    @Override    public void actionPerformed(ActionEvent ev) {        NotifyDescriptor.InputLine inputLine = new NotifyDescriptor.InputLine("Name:", "Data Entry");        Object result = DialogDisplayer.getDefault().notify(inputLine);        if (result == NotifyDescriptor.OK_OPTION) {            Customer customer = new Customer(inputLine.getInputText());            context.doDrop(customer);        }    }} Therefore, when the Properties window, for example, is selected, the Action will be disabled. (See the Zoomable example referred to in the link above for another example of this.) As you can see above, when the Action is invoked, a Droppable must be available (otherwise the Action would not have been enabled). The Droppable is obtained in the Action and a new Customer object is passed to its "doDrop" method. The above in pictures, take note of the enablement of the toolbar button with the red dot, on the extreme left of the toolbar in the screenshots below: The above shows the JButton is only enabled if the relevant TopComponent is active and, when the Action is invoked, the user can enter a name, after which a new LabelWidget is created in the Scene. The source code of the above is here: http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.3/misc/WidgetCreationFromAction Note: Showing this as an MVC example is slightly misleading because, depending on which model object ("Customer" and "Droppable") you're looking at, the V and the C are different. From the point of view of "Customer", the TopComponent is the View, while the Action is the Controler, since it determines when the M is displayed. However, from the point of view of "Droppable", the TopComponent is the Controler, since it determines when the Action, i.e., which is in this case the View, displays the presence of the M.

    Read the article

  • Angular function constructor in Controller

    - by BigHeadCreations
    In normal JS I can do this: function Droppable() { this.relevant = true; this.uuid = generateUUID(); }; var generateUUID = function() { return '12345'; } console.log(new Droppable); // returns Droppable {relevant: true, uuid: "12345"} But in Angular I have this: angular.module('myApp').controller('MyCtrl', ['$scope', function($scope) { function Droppable() { this.relevant = true; this.uuid = generateUUID(); } var generateUUID = function() { return '12345'; } // initalize droppable areas $scope.region1 = [new Droppable]; $scope.region2 = [new Droppable]; $scope.region3 = [new Droppable]; }]); I am trying to make 3 droppable areas all with a UUID. But when I do this I get 'undefined is not a function' referring to the line this.uuid = generateUUID(); in function Droppable() {...} Why is that?

    Read the article

  • jquery ui drag and drop showing feedback

    - by sea_1987
    Hi there, I have some drag and drop functionality on my website, I am wanting to hightlight the area that is droppable with a chage in border color when the draggable element is clicked/starting to be dragged. If the click/or drag stops I want the border of the droppable element to change back to its origianl state, I currently have this code, but it does not work very well. $(".drag_check").draggable({helper:"clone", opacity:"0.5"}); $(".drag_check").mousedown(function() { $('.searchPage').css("border", "solid 3px #00FF66").fadeIn(1000); }); $(".drag_check").mouseup(function(){ $('.searchPage').css("border", "solid 3px #E2E5F1").fadeIn(1000); }) $(".searchPage").droppable({ accept:".drag_check", hoverClass: "dropHover", drop: function(ev, ui) { var droppedItem = ui.draggable.children(); cv_file = ui.draggable.map(function() {//map the names and values of each of the selected checkboxes into array return ui.draggable.children().attr('name')+"="+ui.draggable.children().attr('value'); }).get(); var link = ui.draggable.children().attr('name').substr(ui.draggable.children().attr('name').indexOf("[")+1, ui.draggable.children().attr('name').lastIndexOf("]")-8) $.ajax({ type:"POST", url:"/search", data:ui.draggable.children().attr('name')+"="+ui.draggable.children().val()+"&save=Save CVs", success:function(){ window.alert(cv_file+"&save=Save CVs"); $('.shortList').append('<li><span class="inp_bg"><input type="checkbox" name="remove_cv'+link+'" value="Y" /></span><a href="/cv/'+link+'/">'+link+'</a></li>'); $('.searchPage').css("border", "solid 3px #E2E5F1").fadeIn(1000); }, error:function() { alert("Somthing has gone wrong"); } }); } });

    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 Drag/Drop problem: mousemove Event not binding for some elements

    - by saturdayplace
    Using the latest jQuery/UI that are hosted at Google. I've got the following markup: <ul id="tree"> <li><a href="1/">One</a></li> <li><a href="2/">Two</a></li> </ul> And the following javascript: $(document).ready(function(){ // Droppable callbacks function dragOver(overEvent, ui_object) { $(this).mousemove(function(moveEvent){ console.log("moved over", this); }); } function drop_deactivate() { $(this).unbind(); } function drag_out() { $(this).unbind(); } // Actual dragging $("#treeContainer li").draggable({ revert: true, revertDuration: 0 }); // Actuall dropping $("a").droppable({ tolerance: "pointer", over: dragOver, deactivate: drop_deactivate, out: drag_out }); }); If I drag the first li down over the second, the mousemove function fires (and firebug logs the output). But if I drag the second li up over the first, the mousemove function doesn't fire. You can see this live at http://jsbin.com/ivala. Is there a reason for this? Should I be trapping the mousemove event in some other way? Edit: It appears as thought the mousemove() event isn't binding for earlier elements than the one currently being dragged (should be bound upon their mouseover).

    Read the article

  • Bind two images together to be dragged

    - by Ryan Beaulieu
    I'm looking for some help with a script to drag two images together at once. I currently have a script that allows me to drag thumbnail images into a collection bin to be saved later. However, some of my thumbnails have an image positioned over the top of them to represent these thumbnail images as "unknown" plants. I was wondering if someone could point me in the right direction as to how I would go about binding these two images together to be dragged. Here is my code: $(document).ready(function() { var limit = 16; var counter = 0; $("#mainBin1, #mainBin2, #mainBin3, #mainBin4, #mainBin5, #bin_One_Hd, #bin_Two_Hd, #bin_Three_Hd, #bin_Four_Hd, #bin_Five_Hd").droppable({ accept: ".selector, .plant_Unknown", drop: function(event, ui) { counter++; if (counter == limit) { $(this).droppable("disable"); } $(this).append($(ui.draggable).clone()); $("#cbOptions").show(); $(".item").draggable({ containment: "parent", grid: [72,72], }); } }); $(".selector").draggable({ helper: "clone", revert: "invalid", revertDuration: 700, opacity: 0.75, }); $(".plant_Unknown").draggable({ helper: "clone", revert: "invalid", revertDuration: 700, opacity: 0.75, }); }); Any help would be greatly appreciated. Thanks. EDIT: Website

    Read the article

1 2 3 4  | Next Page >