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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Events with IFRAME auto scroll

Status
Not open for further replies.

fixthebug2003

Programmer
Joined
Oct 20, 2003
Messages
294
Location
US
Hi,
I have an IFrame with scrolling attribute set to "auto".
When the data in the IFrame exceeds the height of the IFRAME, the vertical scroll bar automatically appears.

My Question is : is there an Event that fires when the vertical scroll bar appears..ie when the data in the IFRame exceeds the height of the IFRAME?

Fixthebug2003
 
there is no Event as such but u can trap it:

if(document.body.clientHeight<document.body.scrollHeight)
{
alert("Hey its a scrollbar!!!!")
}

place this code at the end of all ur HTML code...

Known is handfull, Unknown is worldfull
 
there is no event as such but try this:

if(document.body.clientHeight<document.body.scrollHeight)
{
alert("There should be a scroll bar now.")
}

add this code at the end of all ur HTML code...

Known is handfull, Unknown is worldfull
 
god damn it, i gave the post two times.... ;)

Known is handfull, Unknown is worldfull
 

You should be able to trap the onresize event of the body, and then use vbkris's code in that event to test for the presence of a scrollbar or not.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top