3 posts
  • Has been part of the Envato Community for over 5 years
churyb says

Hi guys,

Please, can somebody help me out with my little problem?

I trying to use nice script what was written in JS. I found that on Hv-designs.

Script is here

Simply i want have gallery with pictures and each picture will start with 30% opacity. And when I hover image it will fade in 100% opacity. When i move out it will fade out back.

Script is working nice but it has one defect. If I hover quickly for many times hover effect repeat for some time. I trying to add $(this).stop(); but when I hover it stop on 100% opacity but dont fadeout back to 30% opacity.

I dont know how can I fix it because I am beginner with javascript and Jquery.

Much thanks for some helpful response.

159 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Located in Europe
+1 more
peex says
2541 posts
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in United States
+9 more
CreatingDrew says

Maybe try something like this:


$('#ad img').css('opacity', 0.3);
$('#ad img').hover(function(){
            $(this).stop().animate({opacity: 1},1000);
        },function(){
            $(this).stop().animate({opacity: 0.3},1000);
        });

I’ve used this before on one of my websites with success :) Good luck!

3 posts
  • Has been part of the Envato Community for over 5 years
churyb says
Maybe try something like this:

$('#ad img').css('opacity', 0.3);
$('#ad img').hover(function(){
            $(this).stop().animate({opacity: 1},1000);
        },function(){
            $(this).stop().animate({opacity: 0.3},1000);
        });

I’ve used this before on one of my websites with success :) Good luck!

Thanks but this isnt working for me. Dont know why. :( I’ve tried different ways how to set it up but i failed. Can you show me this script on some example page ?

2541 posts
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in United States
+9 more
CreatingDrew says
Maybe try something like this:

$('#ad img').css('opacity', 0.3);
$('#ad img').hover(function(){
            $(this).stop().animate({opacity: 1},1000);
        },function(){
            $(this).stop().animate({opacity: 0.3},1000);
        });

I’ve used this before on one of my websites with success :) Good luck!
Thanks but this isnt working for me. Dont know why. :( I’ve tried different ways how to set it up but i failed. Can you show me this script on some example page ?
No problem, take a quick look at the demo I set up here:

http://dev-tips.com/demo/churyb.html

Let me know if that helps.

3 posts
  • Has been part of the Envato Community for over 5 years
churyb says

Thans very much bro’ ;) You really solved my problem. Thanks again

2541 posts
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in United States
+9 more
CreatingDrew says
Thans very much bro’ ;) You really solved my problem. Thanks again
Your very welcome, I’m glad you got your problem solved :)
by
by
by
by
by
by