Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
WEB: Web Design Forum- TutorialsDreamweaver Forum- TutorialsFlash Forum- TutorialsWeb StreamingTraining

Re: Help with simple jQuery + png image rotator

Cow Forums : Web Design
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: Help with simple jQuery + png image rotator
by Clint Milner on Oct 14, 2009 at 7:58:13 am

Hi Fernando,

Yeah I the rotation works well, but I was trying to get the other pictures that don't have a z-index of 2 to be invisible so only one is showing at a time. After sleeping on it for a night I think that I have a fix, but still need to check it out on other OS/Browsers.

http://www.castleford-printing.com/business-cards.html

I've just set all the images in the #photoShow to have an opacity of 0.0 and then gave the first image a .current class and then set that to have an opacity of 1.0.

Here's the code incase anyone is curious:
$(function() {
setInterval("rotateImages()", 3000);

var clearPic = $("#photoShow div");
clearPic.animate({opacity:0.0},0);
var showInit = $("#photoShow div.current");
showInit.animate({opacity:1.0},500);
});

function rotateImages() {
var curPhoto = $("#photoShow div.current");

var nextPhoto = curPhoto.next();

if (nextPhoto.length == 0)
nextPhoto = $("#photoShow div:first");

curPhoto.removeClass("current").addClass("previous").animate({opacity:0.0},1000);
nextPhoto.css({opacity:0.0}).addClass("current").animate({opacity:1.0}, 1000,
function() {
curPhoto.removeClass("previous");
});
}



Thanks Fernando,

Clint

Adobe CS4 Master Suite
Vista Ultimate 64 SP1
Intel Core i7 920 @ 3.60GHz
12 GB DDR3 RAM
NVidia Quadro FX 3700
Matrox RT.X2 LE Capture Card
4 TB RAID 5


Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:




Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]