[thelist] XHTML and onscroll

Hershel Robinson hershelr at netvision.net.il
Mon Aug 26 08:01:01 CDT 2002


I have a framed XHTML page where the top frame is navigation, including
tabs.  This frame is scrolling="no" and so no scroll bar shows up.  We have
found, however, that if one places the mouse somewhere in this frame and
then drags downward to select text, that when the mouse moves off the frame,
the frame will indeed scroll upward to allow him to see the remaining text.
Most of us are probably familiar with this behavior.

The problem is, I do not want this to happen.  I don't expect that users
will perform this action very often, but even so I certainly want to
safeguard against it.

Internet Explorer (in recent versions at least) supports an onscroll event
for a document.  By capturing this event, I can reset the vertical position
of the frame back to zero whenever it moves.  It flashes a bit, but it
works.

The problem is that this event is NOT part of XHTML 1.0.  Here is a sample
page:
http://hclic.gwsystems.co.il/hershel/jokermain.htm
(ignore the content for the most part--it's half garbage)

This page (the top frame that is) has the XHTML header removed and so my
flashing onscroll event works.  With the header, however, it does not work.
I presume then that this onscroll event is an IE quirks mode feature.  The
site I am working only supports IE, so I may have to just leave it as is.  I
would like to write proper XHTML code, however.

Does anyone have any ideas as to how I can prevent this scrolling behavior?

Thanks,
Hershel




More information about the thelist mailing list