SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: question
-
Jan 27, 2002, 17:48 #1
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
question
i know that simple rollover scripts are rather easily done. however, a client wants me to do something and i'm not sure if it's possible... and if it is, how difficult it would be.
if you take a look at the production site at
http://www.asciant.com/temp/queotek/
you'll notice in the right bar "why ____". under it will be five links. now when you hover over any of the five links, certain parts of the image (the main image in the center) will "light up." i have already broken that image down into tables and i have the "rollover" images set. so maybe when you hover over bullet 1 under 'why queotek,' the 'metrics for success/advisory services/and solutions landscape' will change images.
the changes will be different for each bullet.
on top of that, i need simple rollovers for each of those images.
is this possible? can anyone help me or point me in the right direction?
thanks a bunch
-
Jan 27, 2002, 18:20 #2
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
create an array for your default images (imageArray)
another for the highlighted/mouseovers (imageHigh)
(or put both in the same array even = default; odd = high)
onmouseover="swapImage(1)"
function swapImage(imgNum)
{
// set all to default
for (i = 0; i < numOfImages; i++)
document.images[imgName + i].src = imageArray[i]
documentimages[imgName + imgNum].src = imageHigh[imgNum];
}
or something like above (i'm busy watching the nfc championship)
VinnyWhere the World Once Stood
the blades of grass
cut me still
-
Jan 30, 2002, 03:03 #3
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ugh. can someone help me with this? if you can do this, please PM me...
-
Jan 30, 2002, 10:24 #4
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
ugh.
VinnyWhere the World Once Stood
the blades of grass
cut me still
-
Jan 30, 2002, 19:36 #5
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
both
ok i have a clarification request then. is there anyway to code a text link onMouseover to have it switched two (or more) images at once?
-
Jan 31, 2002, 10:15 #6
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi
and what's wrong with ...onmouseover="func1();func2()"
or
...onmouseover='func1()'
function func1()
{
for (i = 0; i < 2; i++)
func2(i)
}
btw: well, I have to agree I'm not too thrilled the JETS didn't make it, but I would like to see the Pats cream the Rams
VinnyWhere the World Once Stood
the blades of grass
cut me still
-
Feb 1, 2002, 16:23 #7
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, you're going ot hav eto hold my hand on this... my understandin go javascript is from nothing to ... nothing.
i tried to use that semicolon thing but i got an error. can you try to take a look at www.queotek.com/index.asp and tell me why? i'm utterly lost...
-
Feb 1, 2002, 16:41 #8
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
you're going ot hav eto hold my hand on this
errors on lines 25 & 29:
line 25:
document[iname].src = iArray[iname][1].src;
should be:
document.images[iname].src = iArray[iname][1].src;
document.images is the name of the built-in array for images
when dealing with the DOM, realize that each dot "." implies an array may follow. This is because array cells (the thing inside the square brackets "[]") can contain arrays.
So, when someone says 'document.images', they mean an array called 'images' inside an object called 'document', which means it can also be used as "document['images']"
to see what I mean add the alerts below:
function ImageOn(iname)
{
if (bCap)
{
alert(document['images'][iname].src)
alert(document.images[iname].src)
document.images[iname].src = iArray[iname][1].src;
alert(document.images[iname].src)
}
}
Hope this muddles it up some
VinnyWhere the World Once Stood
the blades of grass
cut me still
-
Feb 1, 2002, 16:55 #9
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I just tried adding that instead of thhe old function, and now when i hover over stuff, multiple windows pop-up
.... completely confused now ...
-
Feb 1, 2002, 23:38 #10
- Join Date
- Jan 2001
- Location
- Chapel Hill, NC
- Posts
- 160
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nevermind i got it to work
stupid me tried to use an undefind array as partof hte scipr t(whoops)
Bookmarks