drag within scrollable div

A

Andrew Poulos

How do I make an object that's within a DIV, whose overflow style is set
to "auto", draggable? I've had a number of goes but the ways I've tried
depend on absolutely positioning the object which means it gets dragged
"out" of the DIV.

It doesn't matter how far a user drags the object.

Andrew Poulos
 
G

Gregor Kofler

Andrew Poulos meinte:
How do I make an object that's within a DIV, whose overflow style is set
to "auto", draggable? I've had a number of goes but the ways I've tried
depend on absolutely positioning

Why? Position it relatively.


Gregor
 
A

Andrew Poulos

Gregor said:
Andrew Poulos meinte:

Why? Position it relatively.

Yep, you're right. It needed to be positioned but not necessarily
absolutely.

Andrew Poulos
 
T

Thomas 'PointedEars' Lahn

Andrew said:
How do I make an object that's within a DIV, whose overflow style is set
to "auto", draggable? I've had a number of goes but the ways I've tried
depend on absolutely positioning the object which means it gets dragged
"out" of the DIV.

It doesn't matter how far a user drags the object.

The positioning scheme of a dragable object does not really matter as long
as you calculate its new position as its old position plus the difference
between the new and old cursor coordinates, while keeping the positioning
scheme (except setting "static" to "relative"). It appears that this is
also the most efficient and most compatible approach.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top