我目前正在努力使pagination插件與我的網站一起工作。當我加載頁面時,使用螢火蟲時沒有錯誤,但沒有顯示結果的數字。這是駕駛掩體。jquery分頁不起作用
這裏是我使用的JS文件:
function handlePaginationClick(new_page_index, pagination_container) {
// This selects 20 elements from a content array
for(var i=new_page_id;i<3;i++) {
$('#MyContentArea').append(content[i]);
}
return false;
}
// First Parameter: number of items
// Second Parameter: options object
$("#News-Pagination").pagination(122, {
items_per_page:3,
callback:handlePaginationClick
});
另外,我想你可能想在網頁源:
<!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>Online Marketing Solutions | Krypton Media</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.pagination.js"></script>
<script type="text/javascript" src="listing.js"></script>
<link rel="stylesheet" type="text/css" href="pagination.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="login-nav">
<a href="login.php">Please Login!</a> </div>
<div id="top-nav">
<a href="index.php">Home</a>
<a href="sites.php">Sites</a>
<a href="register.php">Sign-Up</a>
<a href="login.php">Login</a>
<a href="myac.php">My Account</a>
</div>
<div id="page-wrap">
<div id="curve-container"></div>
<div id="main-content">
<div id="article-area">
<h1>Sites</h1>
<div id="output-listings">
<div id="MyContentArea" class="site-listings">
<div id="main-info-1" class="maini">
Leftlane News
www.leftlanenews.com/
<a id="link-1" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-1" class="mi">
<span class="description">Leftlane News is a leading source for automotive industry and vehicle news. Read by driving enthusiasts, car shoppers, autoworkers, executives, and investors, it is updated throughout the day with the very latest auto news as it happens. No other site brings together the same degree of timeliness, thoroughness and accuracy as Leftlane News.</span>
</div>
<div id="main-info-2" class="maini">
Motor Authority
www.motorauthority.com/
<a id="link-2" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-2" class="mi">
<span class="description">Motor Authority is a global news source specializing in automotive industry, product and motorsport news with a skew towards high-performance and luxury segments. Motor Authority is always at the forefront of cutting edge and breaking news and provides 24-hour coverage of all the events and happenings in the automotive world.</span>
</div>
<div id="main-info-3" class="maini">
Autoblog
http://www.autoblog.com/
<a id="link-3" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-3" class="mi">
<span class="description">Autoblog.com is a web site that offers daily weblogs and podcast news and commentary about automobiles and the automotive industry. It is part of the Weblogs, Inc. network of media sites which is owned by AOL.</span>
</div>
<div id="main-info-4" class="maini">
Cartensity
cartensity.com
<a id="link-4" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-4" class="mi">
<span class="description">Cartensity is the number one spot to get all your auto needs.</span>
</div>
<div id="main-info-5" class="maini">
Top Gear
http://www.topgear.com/us/
<a id="link-5" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-5" class="mi">
<span class="description">Top Gear site with videos, news, features, blogs from Jeremy Clarkson, Richard Hammond and James May, behind-the-scenes info from the show and car reviews.</span>
</div>
<div id="main-info-6" class="maini">
World Car Fans
http://www.worldcarfans.com/
<a id="link-6" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-6" class="mi">
<span class="description">Daily updated automotive e-zine, focusing on sports and modified cars. Features photo galleries, forums, editorials, and spy photos.</span>
</div>
<div id="main-info-7" class="maini">
Car and Driver
http://www.caranddriver.com/
<a id="link-7" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-7" class="mi">
<span class="description">Our car buying tips help you make informed buying decisions.</span>
</div>
<div id="main-info-8" class="maini">
Yahoo Autos
http://autos.yahoo.com/
<a id="link-8" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-8" class="mi">
<span class="description">See new car pictures, find out new car prices and read new car reviews on Yahoo! Autos. Compare cars and get a free price quote from dealers near you.</span>
</div>
<div id="main-info-9" class="maini">
Road and Track
http://www.roadandtrack.com/
<a id="link-9" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-9" class="mi">
<span class="description">Road & Track - serving up the most authoritative collection of road tests, future cars, spy shots, auto show coverage, comparison tests, driving impressions</span>
</div>
<div id="main-info-10" class="maini">
Car Advice
http://www.caradvice.com.au/
<a id="link-10" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-10" class="mi">
<span class="description">CarAdvice.com.au is Australia�s fastest growing automotive editorial site.Our experienced team leaps at the opportunity to answer reader�s questions and get involved in discussion.The passionate, professional team sets CarAdvice aside from the competition.</span>
</div>
<div id="main-info-11" class="maini">
Car.com
http://www.car.com/
<a id="link-11" class="more-info-link" href="#">More info</a>
</div>
<div id="more-info-11" class="mi">
<span class="description">Car Reviews, Car Financing, and a Free non-obligation Price Quote on new cars, trucks, suvs. The the Cars.com alternative. Buy or finance your next car</span>
</div>
</div>
</div><!--end output-listings-->
<div id="News-Pagination"> </div>
</div>
<div class="clear"></div>
</div>
<div id="footer"></div>
<div id="curve-container"></div>
<div id="features">
<div id="p-header">
<h1></h1>
<p></p>
</div>
</div>
<div id="ft-bottom"></div>
<div id="text-footer"><p>Copyright © 2009. All rights reserved.</p></div>
</div>
</body>
</html>
我只想顯示每頁3日上市。
任何幫助將是偉大的。謝謝。
它是否在文檔就緒功能? – redsquare 2009-07-20 19:03:47
剛剛添加了ready函數和數字顯示,但我得到這個錯誤在螢火蟲 - > new_page_id沒有被定義 [打破這個錯誤] for(var i = new_page_id; i <3; i ++){<有人知道這是什麼意思? – Spyderfusion02 2009-07-20 19:09:46