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 3 of 3

Thread: image rollover

  1. #1
    Regular Coder Zangeel's Avatar
    Join Date
    Oct 2007
    Location
    public_html/
    Posts
    638
    Thanks
    17
    Thanked 79 Times in 79 Posts

    image rollover

    im using this in a script i have
    http://www.dynamicdrive.com/dynamicindex4/image5.htm

    now, i put the js in my header

    and changed the image tags like this

    Code:
    {img alt="Gallery" src="`$sGImageUrl`thumb/`$aItem.id`.jpg" src_def="design/pic/noimage_120.jpg" style="vertical-align:middle;filter:alpha(opacity=20);-moz-opacity:0.2" class="pic1" onMouseover="this.className='pic2';makevisible(this,'0')" onMouseout="this.className='pic1';makevisible(this,'1')" height="90px" width="90px"}
    script uses smarty.
    now wehn i did that, it made the images dull, but when i mousover, it doesn't brighten!

  • #2
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    It may have something to do with the changing classes you should probably make sure they don't interfere with the outcome of the script

  • #3
    New Coder
    Join Date
    Aug 2008
    Location
    Colfax, California USA
    Posts
    64
    Thanks
    3
    Thanked 5 Times in 5 Posts
    first off that script does not support safari second you can get the same effect using CSS

    CSS code:
    Code:
    <style type="text/css">
    #effect {filter: alpha(opacity=20);
    opacity:0.2;
    }
    #effect:hover {filter: alpha(opacity=100);
    opacity:1;}
    </style>
    how to apply it to a image in your html: the bolded is important
    Code:
    <img src="your/image/path/goes/here" id="effect"></img>
    an a simple javascript may be needed to support IE6, IDK if that javascript I just wrote works I don't have ie6 to test on nor do I know any javascript.
    Code:
    <img src="your/image/path/goes/here" id="effect" onmouseover="getElementById(effect).style.filter = (alpha(opacity=100))"></img>
    Last edited by rhinodog8; 08-18-2008 at 08:47 AM.


  •  

    Posting Permissions

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