Draggable floatbox reverts to original screen position during gallery navigation

Page: 1

Author Post
gregp
Guest
I don't use draggable Floatboxes but this may affect those who do. When you drag a floatbox to a different location, when you move to another image in the gallery the floatbox moves back to its centre-screen position. I would imagine if you moved an image to a different location on the screen, you'd want it to stay there when you move to the next image.

Can this be done?

Thanks,
Greg
Administrator
Registered: Aug 2008
Posts: 3382
Hi Greg,

Draggable floatboxes are a bit of a conundrum for me. Here's the whole saga.

There is a reasonable demand for the ability to place the controls and captions at the top of the floatbox frame to match standard user interface windows. Close buttons are always at the top right (Windows) or top left (Mac) except in lightbox clones where the close button is nearly always at the bottom of the window. A consistent user interface is a good thing. However, aesthetically, when displaying images, the captions and controls look better at the bottom - less intrusive, and the larger frame area looks like its supporting, rather than bearing down upon, the image.

Ok, so the ability to put the controls and caption up top was added. Now, when the controls are on top, it starts looking like a standard window. All standard windows are draggable, and as I was testing the top placement it seemed counter-intuitive that the floatbox window wasn't also draggable.

Example: http://floatboxjs.com/demo.php?autoStart=bay.jpg&infoPos=tl&controlPos=tr
It just feels wrong if mouse-tugging on the big title-bar-ish area at the top doesn't move the box. Hence dragging was born.

When I inserted draggability and was testing it out it seemed unnatural that if I moved the box then navigated to the next image in the gallery, the box would not stay moved, but would re-center. (The behaviour you are commenting on.) It was a simple matter to have the box remember its new position so I added code to do that. The resultant behaviour seemed unnatural too. I would drag the box half off-screen, navigate to the new image, and couldn't see the damn thing because it was half off-screen. That didn't seem particularly useful, so I took the sticky code out. I considered adding an option called stickyDrag to let the implementer decide, but I really don't think people want to have to fuss over that fine-grained behaviour.

I'm conflicted about draggability. On the one hand I think, what's the point, but on the other hand it "feels" like the floatbox should be draggable. I suppose I should either remove draggability, or add in that stickyDrag option. Or just leave it like it is because it's not important. I wonder what people want in this regard, or if anyone cares.
gregp
Guest
I reckon make it sticky. People will normally want to move it off centre to arrange the screen the way it suits them, and if for whatever reason they choose to shift it half off-screen they can't really complain if they can't see half the picture! Windows Picture and Fax viewer (the default Preview application in Windows) sticks in its position and while having just dragged it off screen and navigated it was a bit annoying not being able to see the next picture, I think it's more annoying to have it recentre itself when the user has deliberately moved it off-centre for a reason.

I guess you could add StickyDrag as an option if you really want, no harm in letting people customise it the way they want to use it I suppose, but IMHO I think it belongs in the code.

If you want to avoid code bloat, someone recently made a really good suggestion about making a floatbox compiler... http://floatboxjs.com/forum/topic.php?id=120 ;)

Greg
gregp
Guest
... what about resizable floatboxes? :shock: :shock: I found once I dragged it round a bit I wanted to resize it!
Administrator
Registered: Aug 2008
Posts: 3382
Alright, now you're starting to piss me off. :mrgreen:
gregp
Guest
:D don't worry I groaned when I first thought of it too. I mean it would be cool for those who use draggable FBs of course, but where do you stop!?

Page: 1