15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2 ✦ Window and Frame Objects (Chapter 16)<br />

In the toggleFrameScroll() function, the if condition checks whether the<br />

property is set to something other than no. This allows the condition to evaluate to<br />

true if the property is set to either auto (the first time) or yes (as set by the function).<br />

Note that the scrollbars don’t disappear from the frames in IE5.5 or NN6.<br />

Listing 16-45: Controlling the FRAME.scrolling Property<br />

<br />

<br />

frame.scrolling Property<br />

<br />

<br />

function toggleFrameScroll(frameID) {<br />

// IE5 & NN6 version<br />

var theFrame = document.getElementById(frameID)<br />

// IE4+ version<br />

// var theFrame = document.all[frameID]<br />

if (theFrame.scrolling != “no”) {<br />

theFrame.scrolling = “no”<br />

} else {<br />

theFrame.scrolling = “yes”<br />

}<br />

}<br />

// generate content for each frame<br />

function fillFrame(frameID) {<br />

var page = “”<br />

page += “This frame has the ID of:” + frameID + “.”<br />

page += “”<br />

return page<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

193<br />

FRAME.scrolling

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!