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
  • Sells items exclusively on Envato Market
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 :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by