Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts

    make mouseover unobtrusive

    Hi,
    I have this code but want to put the event handlers in a javascript file unobtrusively. Can this be done.

    I will be attaching the mousovers to many divs.

    Thanks,
    C

    <div onMouseOver="onmouseoverHover(this)"
    onmouseout="onmouseoutHover(this)">
    <a href="movies/aptana_colorization/colorization.html" target="_blank">
    <img alt="" src="thumb_overlay.png" class="overlay"/>
    <img src="screenshot_colorization_thumb.png" alt="View Video" class="thumbnail"/>

    </a>
    </div>

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Code:
    var div = document.getElementById("linkDiv");
    div.onmouseover = function(){
      onmouseoverHover(this);
    }
    div.onmouseout = function(){
      onmouseoutHover(this);
    }
    Code:
    <div id="linkDiv">
      <a href="movies/aptana_colorization/colorization.html" target="_blank">
      <img alt="" src="thumb_overlay.png" class="overlay"/>
      <img src="screenshot_colorization_thumb.png" alt="View Video" class="thumbnail"/></a>
    </div>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •