Web Analytics Made Easy -
StatCounter Highlight Image II script - CodingForum

Announcement

Collapse
No announcement yet.

Highlight Image II script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Highlight Image II script

    I would like to have the border in the following script:
    http://www.dynamicdrive.com/dynamici...highlight2.htm
    remain visible until the focus is changed by mousing over the next image. This event would then trigger the first images border to hide and again the border remain visible on the newly moused over image. Any suggestions?

  • #2
    That's easy.

    Remove the onmouseout event handler!

    eg: onMouseout="borderit(this,'white')"

    .....Willy

    Edit: I got to thinking that had to be too easy.
    Try this:
    Code:
    <style type="text/css">
    .borderimage {
    border:1px solid white;
    }
    </style>
    <script type="text/javascript">
      function borderit(b,color) {
       var howMany = 3;
       var d = document.images;
        for(a=1; a<=howMany; a++) {
         if(d)
           d['img'+a].style.borderColor = '';
           d['img'+b].style.borderColor = color;
         }
      }
    
    </script>
    </HEAD>
    
    <BODY>
    <img id="img1" class="borderimage" src="man.gif" onMouseover="borderit(1,'yellow')">
    <img id="img2" class="borderimage" src="man.gif" onMouseover="borderit(2,'green')">
    <img id="img3" class="borderimage" src="man.gif" onMouseover="borderit(3,'red')">
    Last edited by Willy Duitt; Feb 7, 2004, 01:45 AM.

    Comment


    • #3
      Highlight Image II script

      Thanks Willy Duitt! Absolutely perfect, again. I too thought removing the onMouseout handler should do the trick. Sorry, I didn't mention that in my posting. When I tried and found it wasn't going to be so simple. I thought I'd better post it. Many thanks again. Now, on to Scroller II.

      Roxie

      Comment

      Working...
      X