我想知道我怎样才能使这个作为一个简单的代码,我在网站上找到了一些我想用于一个网站的工作,这个东西是我试图把它放在我的网站(一个非常简单的)但我不能让它工作。 有谁知道我怎么能让它成为一个简单的代码?如何用jquery制作进度条?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>eBay PayPal</title>
<style type="text/css">
*{margin:0; padding:0;}
body{background:#FFFFFF url(images/1.jpg) top left no-repeat; width:1099px; height:1050px;}
</style>
<script src="http://jquery-ui.googlecode.com/svn/tags/1.7.2/jquery-1.3.2.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var p=0;
$("#myProgressBar").progressbar({value:0});
var timer = setInterval(function(){
//This animates the bar
$("#myProgressBar .ui-progressbar-value").animate({width: p+"%"},500);
//This does static sets of the value
//$("#myProgressBar").progressbar("option","value",p);
p = p +33.33;
if(p>33.33){
$("#myProgressBar .ui-progressbar-value").animate({width: "33.33%"}, 500);
//$("#myProgressBar").progressbar("option","value",100);
clearInterval(timer);
}
},500);
});
</script>
</head>
<body>
<a href="2.html" style="width:185px; height:31px;position:absolute; left: 198px; top: 516px;"></a>
<div id='myProgressBar' style="position:absolute; border:1px red solid; height:41px; width:950px; left: 69px; top: 608px;"></div>
</body>
</html>`
我想知道如果有人能帮助我吧,基本上我想只是一个上有一个进度条页面。 CA
非常感谢你的帮助,任何机会,你有什么想法如何动画? – karlelizabeth 2012-01-11 06:51:13
没问题,我想这个答案会帮助你:http://stackoverflow.com/questions/5047498/how-do-you-animate-the-value-for-a-jquery-ui-progressbar。 – 2012-01-11 07:06:51
你知道为什么我的代码现在工作吗? http://jsfiddle.net/gPfBC/当我尝试使它在我的HTML文件内工作时,只是不工作! – karlelizabeth 2012-01-11 07:37:20