Forum Moderators: open

Message Too Old, No Replies

<div id="gag"> positioning & sizing

         

Sothpaw

9:03 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



my JavaScript requires my rollover function to be in a
<div id="gag"> tag.
i would prefer to use
<div class="gag"> so i could reference the sizing with CSS
since i can't... is it possible to describe my size and position with JavaScript?

Demaestro

9:05 pm on Jun 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can use both tags if you want... the class for CSS definitions and the id for referencing in JS

Sothpaw

9:23 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



like this...?
<div id="gag" class="gag">

Sothpaw

9:26 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



HORAY it works...
only one problem... the picture still doesn't scale. the first one does... but the future ones that are JavaScript based do not.

Demaestro

2:06 pm on Jun 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you are going to have more then one image tag with the id="gag"

Then you will have to set up your JS to deal with an array of objects that have the id="gag" rather then code that assumes there is only one.

Are you familiar with loops?

Sothpaw

3:19 pm on Jun 28, 2007 (gmt 0)

10+ Year Member



loops? no.
but the JavaScript is already set up by our old Webmaster who got the JS code from a free ware site and it looks like this.

//Specify image paths and optional link (set link to "" for no link):
var gag=new Array()
gag[1]=["001.jpg", ""]
gag[2]=["002.jpg", ""]
etc.

i just want the width to show up with a specific size and not the original photo size.