SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    ********* Poet X Q mano's Avatar
    Join Date
    Oct 2002
    Location
    Still Thulcandra
    Posts
    997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with a simple rollover...

    Hi,

    I posted this in the troubleshooting section also, but I couldn't seem to get any views there... Sorry for my impatience, but I need an answer as fast as possible, so I would appreciate it a lot if someone could help...

    I've been making a rather simple site. The navigation was supposed to use rollover, and they were working fine.

    I made some alterations, and all of a sudden it starts to freak out a little...

    On the pages that I made the alterations today, they don't work, on the ones I changed yesterday, they work...

    The ones that doesn't work looks something like this:

    Image8= new Image(80,60)
    Image8.src = "images/button04h.jpg"
    Image9= new Image(80,60)
    Image9.src = "images/button05.jpg"
    Image10= new Image(80,60)
    Image10.src = "images/button5h.jpg"

    function SwapOut4() {
    document.imageflip4.src = Image8.src; return true;
    }

    function SwapBack4() {
    document.imageflip4.src = Image7.src; return true;
    }

    function SwapOut5() {
    document.imageflip5.src = Image10.src; return true;
    }

    function SwapBack5() {
    document.imagflip5.src = Image9.src; return true;

    And in the actual page I have this:

    <a href=index.htm OnMouseOver="SwapOut4()" OnMouseOut="SwapBack4()">
    <img name=imageflip4 width=80 height=60 src=images/button04.jpg alt="Til Forsiden">
    </a>

    <a href=omoss.htm OnMouseOver="SwapOut5()" OnMouseOut="SwapBack5()">
    <img name=imageflip5 width=80 height=60 src=images/button05.jpg alt="Om Skap en forandring">
    </a>

    I get the message that "object expected" or something in the first line of the <a> tags...

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Try changing these -
    Code:
    function SwapBack5() {
    document.imagflip5.src = Image9.src; return true;
    
    // change to
    
    function SwapBack5() {
    document.getElementByIf('imagflip5').src = Image9.src; return true;
    
    // and this
    
    <img name=imageflip4 width=80 height=60 src=images/button04.jpg alt="Til Forsiden">
    
    // to
    
    <img name=imageflip4 id=imageflip4 width=80 height=60 src=images/button04.jpg alt="Til Forsiden">
    I realised after typing this that I chose two example that don't match (4 & 5) but I'm sure you get the idea

    Hope that helps

  3. #3
    ********* Poet X Q mano's Avatar
    Join Date
    Oct 2002
    Location
    Still Thulcandra
    Posts
    997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I'll get it!

    Thanks!


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
  •