I have a script that tells how a hover animation (opacity) should work on specific images. The images should be 50% opacity by default and then go 100% opacity on hover and back to 50% on mouse out.
I got the "hover" and "mouse out" funktions working, but I don't know how to tell it to set the images to 50% opacity when page loads...
I have very little Java script experience, but I think this should be fairly easy to accomplish by adding something to the script above... I need it to tell all IMG in "Portfolio-item" to be 50% opacity.
I think you are in the wrong forum. This has nothing to do with Umbraco but is simple jQuery. And it not a job offer you are giving, so also the wrong section in here.
Need Java Script help...
Hi guys
I have a script that tells how a hover animation (opacity) should work on specific images. The images should be 50% opacity by default and then go 100% opacity on hover and back to 50% on mouse out.
I got the "hover" and "mouse out" funktions working, but I don't know how to tell it to set the images to 50% opacity when page loads...
My script looks like this:
<script type="text/javascript">
var J = jQuery.noConflict();
J(document).ready(function(){
//Portfolio hover
J(".portfolio-item img, .image-nav img").hover(
function() {
J(this).animate({"opacity": "1"}, "slow");
},
function() {
J(this).animate({"opacity": "0.5"}, "slow");
});
I have very little Java script experience, but I think this should be fairly easy to accomplish by adding something to the script above... I need it to tell all IMG in "Portfolio-item" to be 50% opacity.
Can someone please help me?
// Mikkel
Hi Mikkel,
I think you are in the wrong forum. This has nothing to do with Umbraco but is simple jQuery. And it not a job offer you are giving, so also the wrong section in here.
But an answer could be something like
$(".portfolio-item img").css({ opacity: 0.5 });
Just under the ready function
/Peter
Yes, I know... But I didn't know which section to post it under.
And I thought people maybe would help me out even though it has nothing specific to do with umbraco... And I guess I was right :)
That solved it... Thank you very much, Peter :)
// Mikkel
My be you're looking for this http://www.dotnetcurry.com/ASPNETandjQuery/Section7-ImageControl/R38-ImageOpacity.aspx and here is the tutorial of this example http://www.dotnetcurry.com/ShowArticle.aspx?ID=438
is working on a reply...