SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    two mouseover events

    Hi,
    Can anyone think of how to cause two mouseover events to occur.
    Basically I have a rollover effect that I would like to cause a hidden layer to become visible (currently I have this as a click event)?
    any ideas?

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do it using with a little tweaking of the trusty swapimagerestore script.

    PHP Code:

    <head>
    <
    script language="javascript">
    function 
    MM_swapImgRestore() { //v3.0
      
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function 
    MM_findObj(nd) { //v4.0
      
    var p,i,x;  if(!dd=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        
    d=parent.frames[n.substring(p+1)].documentn=n.substring(0,p);}
      if(!(
    x=d[n])&&d.allx=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(
    i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!
    && document.getElementByIdx=document.getElementById(n); return x;
    }

    function 
    MM_swapImage() { //v3.0
      
    var i,j=0,x,a=MM_swapImage.argumentsdocument.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((
    x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrcx.oSrc=x.srcx.src=a[i+2];}

    </script>
    </head>
    <BODY>

    <IMG SRC="hiddenimage.gif" NAME="image" />

    <a href="thelink.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image','','image.gif','image2','','image2_on',1)">
    <img src="image2_off.gif" border="0" name="image2" /></a> 

    that should work...
    Last edited by weirdbeardmt; Sep 2, 2001 at 07:58.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for some reason the last post is refusing to render correctly, now matter how i edit it!

    anyway, the very last line should read

    <img src="image2_off.gif" name="image2"></A>
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    London
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    missing parts

    Thanks for the posting but am unable to read the beginning section.

    cheers


  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    onMouseOver="doThing();doThing2"
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  6. #6
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    damn, sunny beat me


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
  •