SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to do a kind of a different rollover?

    I'm trying to build a menu with rollover effect but not the usual. What I want is that, when I pass the mouse over the image, another image changes.

    The best example I found was in this URL:
    www.bauhaus.de/english/bauhausarchiv/index.htm

    Can somebody help me?
    Thanks

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function swapImage(id, src) {
    	var oImg = (document.all) ? eval("document.all."+id) : document.getElementById(id);
    	oImg.src = src;
    	}
    	
    <img onMouseOver="swapImage('img2','pic2.gif');" />
    <img id="img2" src="pic.gif" />
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •