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

<DIV> overflow-x and y

Status
Not open for further replies.

MartinF

Technical User
Sep 19, 2000
143
FR
Hi,

Im trying to use:

window.document.getElementsByName('DIVname');

to access a <DIV> section, i then want to be able to access the overflow-x and y of that DIV's overflow so i can produce a scrolling effect from a loop.....but i dont know how at access these, any ideas?

Thanks.
 
I would give the div an ID and use that

myDiv = document.getElementById(&quot;myDiv&quot;)

myDiv.style.overflowX = 100
myDiv.style.overflowY = 100

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Hi,

Thanks for the response, ive tried your suggestion, however i get an 'Error: Object doesnt support this property or method' on the 'myDiv = document.getElementById(&quot;myDiv&quot;)'
line.

I defining the ID within the <DIV> tag as <DIV ID=&quot;myDiv&quot; style=&quot;...&quot;>

Im not sure if im doing somthing wrong here?

Thanks

 
doh - you cannot use a variable name that is the same as the id....

myDivVar = document.getElementById(&quot;myDivName&quot;)


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Hi,

That bit works ok now, but i get an error &quot;Invalid procedure call or argument&quot; at the next line?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top