javascript - Change direction of animation -
i using cloud effect http://solidgiant.com/2011/02/awesome-cloud-effect/ want change direction of cloud movement. want them move right left, can me this
i done change in direction told nishchay sharma, still 1 problem there, clouds doesnt run in loop.. gte stuck when reach left side :(
in clouds.css, change:
#cloud { ... left: 5%; ... } to
#cloud { ... left: 80%; ... } and in clouds.js change
$("#cloud") .animate( { left: $("#sky").width() }, cloudmoved ? 180000 : 150000, "linear", function() { $(this) .css("left", parseint($(this).css("width"))) cloudmoved = true; cloudmove(); } ) to
$("#cloud") .animate( { left: 0 }, cloudmoved ? 180000 : 150000, "linear", function() { $(this) .css("left", parseint($(this).css("width"))) cloudmoved = true; cloudmove(); } ) do same $('#cloud2') , $('#cloud3'). (change $(..).animate('left') 0.)
further addtion clouds on other corner after complete animation. each cloudmove(), cloud2move() , cloud3move():
change
.animate( { left: 0 }, cloud3moved ? 400000 : 150000, "linear", function() { $(this) .css("left", -parseint($(this).css("width"))) cloud3moved = true; cloud3move(); } ) to
.animate( { left: "-"+$("#cloud").width()+"px" }, cloud3moved ? 400000 : 150000, "linear", function() { $(this) .css("left", parseint($(window).width()+'px')) cloud3moved = true; cloud3move(); } ) note: don't forget change left: option according cloud id.
Comments
Post a Comment