我想知道我怎樣才能使這個作爲一個簡單的代碼,我在網站上找到了一些我想用於一個網站的工作,這個東西是我試圖把它放在我的網站(一個非常簡單的)但我不能讓它工作。 有誰知道我怎麼能讓它成爲一個簡單的代碼?如何用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