`

让text不停往复的运动

阅读更多
<input type="text" id="test10"  class="input_text"/>
			<div>
			<button id="go10">start</button>
			<button id="go11">stop</button>
			</div>


$("#go10").click(function(){
			move($("#test10"));
			return false;
		});
		$("#go11").click(function(){
			$("#test10").stop(true);
			return false;
		});
function move($dom) {
    $dom.animate({left:$(window).width() - $("#test10").width() - $("#test10").position().left},3000)
        .animate({left:0},3000,function () {
             move($dom);
        }
    );
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics