for (var i=1;i<100;i++){
$( "#draggable" + i ).draggable();
}
would have taken care of that
something I noticed: "clicking on the back to list" link hides the draggable divs (because they still "belong" to the divs on the left, even though they have been dragged. you may want to add these two lines to the drop function:
I tried implementing the jquery toggle function for 300, 400, and 800 meal tiles but there is a problem when you toggle back and forth. If you try clicking on for example the 300 cal tiles and then dragging the tile to the right side you will see that if you click on it again that it will disappear from the right side as well.
I gave the draggable divs a new class called rightSide when they're dragged to the right side. You can see that the class has changed because the background color turns to pink. Now that it's a new class I can ask it to show instead of toggle like this:
But instead of showing the right side divs, it toggles back to hide just like the left side divs do. At http://myownmealplanner.com/mealplans/add you can click on the 300, 400, 800 tiles to try it out.
I haven't looked at your code, but it sounds like you didn't read my advice back in post #16
Originally Posted by xelawho
something I noticed: "clicking on the back to list" link hides the draggable divs (because they still "belong" to the divs on the left, even though they have been dragged. you may want to add these two lines to the drop function:
you seem to be creating near identical functions for every element. You should be aware that the real beauty of jQuery is that you can apply the same function to various elements using their class name.
I'll say it once again: the code posted in 18 works fine. You seem to be trying to solve problems that don't actually exist.
removes the draggable div from its original div on the left side and attaches it to the div on the right side (so that when the left hand div is hidden, the newly dropped div remains visible - because before, even though you dragged the div, it kept its position in the DOM)
Code:
$(ui.draggable).css("position","");
removes the weird inline css styling that you had for those divs - I think you changed it now, but before it was making them go way over to the right. You could probably remove this line.
xelawho at http://www.webdeveloper.com/forum/sh...43#post1242743 suggested I use $(ui.draggable).appendTo($(this)); to keep the divs on the right side and now they don't hide when I toggle. It's pretty much working as desired now.
You're very welcome. Glad you got it working. FWIW, I don't really like the way that the "previous" tiles remain visible when you click to see a new set, but I guess that's up to you.
You have to click on the link again to make them disappear. Maybe I will change that some time so it's more intuitive but now I'm stuck on the calendar code. http://myownmealplanner.com/calendars/navigate If I delete the calendar css the right side of Saturdays seems to be the normal width but if it's there then the Saturdays are all squeezed together in one narrow column. I tried deleting css in steps to find out which css code is making it so narrow but I couldn't find it. I'm still working on it.
Bookmarks