Jump to content

need help with this jquery .animate() function


svgmx5

Recommended Posts

I got this function online, that uses the .animate function to add opacity to images when the user hovers over it.

 

my problem is that i'm want to have the images have 50% opacity when the page loads...right now it only does it if the user hovers over it.

<script type="text/javascript">
  $(document).ready(function(){
    $("#project_thumb_navigation img").hover(function() {
      $(this).stop().animate({opacity: "1"}, '1000');
    },
    function() {
      $(this).stop().animate({opacity: "0.5"}, '1000 ');
    });
  });
</script>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.