Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling in the div breaks the script

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
0
0
i have a strange problem...

have a look here:
you can resize the little monday block by dragging on the 2 white lines at the bottom.

now scroll down a little but so you can still see the monday box.

try resizing again.... fail... why?????

most of the source can be found in the html, ignore the commented out bits iv disabled all that for easier bug fixing.

the resize script is here:
it uses the prototype and scriptaculous framework.

any help much apreciated!
thank you


I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Looking through Prototype.js (admittedly, 1.6.0.2, not 1.6.0.3), I see this:

Code:
var Position = {
  // set to true if needed, warning: firefox performance problems
  // NOT neeeded for page scrolling, only if draggable contained in
  // scrollable elements
  includeScrollOffsets: false,

Perhaps you need to set that as you are scrolling your elements?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
that sounded very promising but alas, it didnt help.
in 1.6.0.3 its also under the /deprecated section so not sure its checked anymore.

i have added a debug panel that shows some data on mouseover.

it seems the cursor position being passed to the resize script is relative to the top of the scrolling panel instead of the inner holding div. no idea how to update that... will have a longer look later :/

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
ok iv fixed it with an ugly patch, please let me know if you know if a nicer way to fix this... i.e. more portable.

var prepointer = [Event.pointerX(event), Event.pointerY(event)];
var pointer = [prepointer[0],prepointer[1]+document.getElementById('holder').scrollTop];

there must be some nice way to do this with a prototype setting or function.

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top