Results 1 to 3 of 3

Thread: Hover link on Image MouseOver

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hover link on Image MouseOver

    Hi,
    I have a link and an image next to each other. I want to make the link hovered when I do mouseover on image. How do I do that ?

    Here is the code I have now.
    <a href="javascript:undefined" id="imageLinkId">GMNA</a>&nbsp;

    <script language="javascript">
    if( ... ) {
    document.write('<img src="/graphics/channel/plus.png" id="div18Img" alt="Maximize this section" onMouseOver= >'); }
    else {
    document.write('<img src="/graphics/channel/minus.png" id="div18Img" alt="Minimize this section" onMouseOver= >'); }
    </script>

    Thanks

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    <a href="[address]">[linktext]<img src="[image]"></a>

    Than program your CSS to do a hover on A
    Ryan
    Sevierville, TN

  3. #3
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. The following Code worked for me.

    <span class="imageLink"><a href="index.html">GMNA<script language="javascript">
    if( ... ) {
    document.write('<img src="/graphics/channel/plus.png" id="div18Img" alt="Maximize this section" onMouseOver= >'); }
    else {
    document.write('<img src="/graphics/channel/minus.png" id="div18Img" alt="Minimize this section" onMouseOver= >'); }
    </script></a></span>

    and in the CSS file

    a img{border:none}
    .imageLink a { position:relative; }
    .imageLink a:hover { position:relative; text-decoration:underline }
    .imageLink a img{position:relative; right:-5px;}

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
  •