46 users online (1 members and 45 guests)  


  Results 1 to 5 of 5

Related

  1. One Click Login    Forum: Javascript Forum
    Replies: 1
  2. no right click    Forum: HTML Forum
    Replies: 2
  3. No right click    Forum: HTML Forum
    Replies: 3
  4. No right click!!!!!!!!!    Forum: Javascript Forum
    Replies: 7
  5. no right click    Forum: HTML Forum
    Replies: 7
  1. #1
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Click- and rollover example

    Here is my little example of how to use rollovers and other mouse-events.
    I hope you can use it. Comments and additions are welcome.
    Attached Files Attached Files
    Last edited by HTML; 02-02-2009 at 02:55 PM. Reason: self promotion removed

  2. #2
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Wrong code

    Oh, sorry. something wrong with the src code.
    Here is the right one.
    Attached Files Attached Files

  3. #3
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Re: Click- and rollover example

    edited by admin: self promotion removed (again and for the last time)
    Last edited by HTML; 02-03-2009 at 12:22 PM.

  4. #4
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Re: Click- and rollover example

    Sorry admin, I donīt know that it was you who removed the first one, I thougt it was an error. It will not happen again.

  5. #5
    adamsen's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    128

    Re: Click- and rollover example

    Sorry, I thougt it was an error when my links were removed. But here you
    have the Click- and Rolloverscript once again, just
    upgraded. The only thing you have to do
    is to to type the images in a pre-
    made array, and then it works.

    Click and Rolloverscript 2.0:
    HTML Code:
    <html>
    <head> <title>Rollover and click-test</title>
    <SCRIPT LANGUAGE="JavaScript">
    objimage = new Array(2);
    
    objimage[1]= "images/downloadsnorm.gif"      //Image when normal
    objimage[2]= "images/downloadsover.gif"      //Image when mouse is over
    objimage[3]= "images/downloadsdown.gif"      //Image when pressed
    
    function changeover()
    {
    document['image'].src = objimage[2];
    }
    
    function changeout()
    {
    document['image'].src = objimage[1];
    }
    
    function changedown()
    {
    document['image'].src = objimage[3];
    }
    
    function changeup()
    {
    document['image'].src = objimage[2];
    }
    </SCRIPT>
    
    </head>
    <body>
    <h1>Rollover and click-test</h1>
    <img name="image" src="images/downloadsnorm.gif"
    onmouseover="changeover()" onmouseout="changeout()" onmousedown="changedown()" onmouseup="changeup()">
    
    </body>
    </html>



Tags for this Thread