By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

drag within scrollable div

P: n/a
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
Aug 25 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Aug 25 '08 #2

P: n/a
Gregor Kofler wrote:
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.
Yep, you're right. It needed to be positioned but not necessarily
absolutely.

Andrew Poulos
Aug 25 '08 #3

P: n/a
Andrew Poulos wrote:
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
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Aug 25 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.