views:

366

answers:

3

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!

A: 

I dont think its a z-index problem, i think the problem is that when you move the li over the delete area, its being cut off because its outside its parent ol. I would try moving the li to an ol thats inside the delete area as soon as you mouseover (use the droppable.over event,) that might allow it to display properly.

Yisroel
I agree on this point, thanks, I will investigate the other options first then try this out, Thanks.
unknowndomain
A: 

Actually, it appears the problem is a combination of z-index and the overflow (I removed it). If you change your gallery view CSS to this, it works

#galleryView {
 background: white;
 bottom: 85px;
 left: 0;
 position: fixed;
 right: 0;
 top: 147px;
 z-index: 1000;
}

You might want to have additional gallery images that scroll off to the right instead of down.

fudgey
removing the overflow means it wont scroll down. i'd think thats important. and your z-index gets rid of of the shadows, not as important, but it loses its effect.
Yisroel
It is very difficult to test your code because I can't just save the page and mess around with it... just letting you know.
fudgey
Yeah if I remove the overflow then there is no scrollability and on occasions there may be 50-100 images in the view.@fudgey thanks for the feedback, I don't know of a better way to present this as its all ajax'y perhaps I could suggest using firebug but I don't think it would really benefit in this instance other than to use the console.
unknowndomain
+4  A: 

Try the following options for your .sortable() :

{
  helper: 'clone',
  appendTo: 'document.body'
  zIndex: 10000 //or greater than any other relative/absolute/fixed elements and droppables
}
Zlatev
+1 I found that adding this to the sortable does work, but you must `appendTo: 'body'`, like it already is in the script.
fudgey
@fudgey, never looked at the code. Can't think of any reason `appendTo: 'document.body'` not to work too.
Zlatev
@Zlatev: I can't think of a reason either, but it caused a jQuery error for me.
fudgey
Thanks for this, it was exactly what I needed!
unknowndomain