This is what I want to accomplish.
I have two buttons, when I press the first one it fades out to 50% and when the fade out is complete it fades back up to 100% and then it loops the animation for ever until another button is pressed, and den the next button does exactly the same. So every time a button is clicked it just softly blink…
Is this posible?
I’ve been toying whit this but just don’t get it to work.
<html>
<head>
<title></title>
<style type="text/css">
#blnk a { cursor: pointer; }
</style>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script language="JavaScript" type="text/javascript">
<!--
$("#blnk a img").children().click(function(){
$(this).animate({"backgroundColor":""},500);},
function(){
$(this).animate({"backgroundColor":""},500);});
//-->
</script>
</head>
<body>
<div id="blnk"><a src="#"><img src="http://www.auviproducciones.com/more/imagenes/imagen5.jpg"></a></div>
<div id="blnk"><a src="#"><img src="http://www.auviproducciones.com/more/imagenes/imagen6.jpg"></a></div>
</body>
</html>
I’ve made a jsFiddle that solves your problem. I’m sure you can adapt it to your code : http://jsfiddle.net/SFYGX/2/
Let me explain what I’ve done there: At click, I’m reseting all opacities to 1, and stopping all the animations, and then, I’m starting a recursive loop to animate the clicked item.
(Before trying it, make sure you don’t use duplicate id’s like you are doing now (id=”blnk”))