SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: question

  1. #1
    SitePoint Zealot honging's Avatar
    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

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    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)

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Zealot honging's Avatar
    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...

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    ugh.
    Is that in reference to the nfc championship game or the suggestion?

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    SitePoint Zealot honging's Avatar
    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?

  6. #6
    SitePoint Guru Vincent Puglia's Avatar
    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

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  7. #7
    SitePoint Zealot honging's Avatar
    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...

  8. #8
    SitePoint Guru Vincent Puglia's Avatar
    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
    I don't know about that; we haven't been formally introduced. Besides I don't think my hand would fit through the phone lines


    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
    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  9. #9
    SitePoint Zealot honging's Avatar
    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 ...

  10. #10
    SitePoint Zealot honging's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •