3 posts
  • Has been a member for 5-6 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
  • Bought between 1 and 9 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 5 000 and 10 000 dollars
peex says
2541 posts
  • United States
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
+4 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 a member for 5-6 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
  • United States
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
+4 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 a member for 5-6 years
churyb says

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

2541 posts
  • United States
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 5-6 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
+4 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