Image Fading Change Box - "issues" - If Else Statements
So I am making A photo changing box and I have run into issues when writing the jQuery side of it.
here's my code:
- $('#rightclick').click(
- function(){
- if('#linkone'.opacity="1") {
- $('#linktwo').animate({"opacity": "1"}, (500));
- $('#linkone').animate({"opacity": "0"}, (250));
- } else if('#linktwo'.opacity="1"){
- $('#linkthree').animate({"opacity": "1"}, (500));
- $('#linktwo').animate({"opacity": "0"}, (250));
- } else if('#linkthree'.opacity="1"){
- $('#linkfour').animate({"opacity": "1"}, (500));
- $('#linkthree').animate({"opacity": "0"}, (250));
- } else if('#linkfour'.opacity="1"){
- $('#linkone').animate({"opacity": "1"}, (500));
- $('#linkfour').animate({"opacity": "0"}, (250));
- }
- });
So as you can see I have tried to write If Else statements, problems are that it only change to the first photo when you click on the '#rightclick' button.
So I don't know what to do and I have tried myself for quite some time...
I was also wondering, If the user does not click on anything, then how do I get it to automatically change the image (needs a timer for time per photo)...
thanks for anyone to helps!
Ben.