{"id":477,"date":"2009-12-25T10:33:22","date_gmt":"2009-12-25T02:33:22","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=477"},"modified":"2025-02-06T21:29:58","modified_gmt":"2025-02-06T13:29:58","slug":"jquery%e5%9b%be%e7%89%87%e6%96%87%e6%9c%ac%e6%bb%9a%e5%8a%a8%e5%88%87%e6%8d%a2%e6%8f%92%e4%bb%b6jcarousel%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%e4%b8%8e%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2009\/12\/jquery%e5%9b%be%e7%89%87%e6%96%87%e6%9c%ac%e6%bb%9a%e5%8a%a8%e5%88%87%e6%8d%a2%e6%8f%92%e4%bb%b6jcarousel%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%e4%b8%8e%e8%af%a6%e8%a7%a3\/","title":{"rendered":"jQuery\u56fe\u7247\u6587\u672c\u6eda\u52a8\u5207\u6362\u63d2\u4ef6jCarousel\u4e2d\u6587\u7ffb\u8bd1\u4e0e\u8be6\u89e3"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=477\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=477<\/a><\/p>\n<p><a href=\"http:\/\/sorgalla.com\/jcarousel\/\">jCarousel<\/a>\u662f\u4e00\u6b3e\u5386\u53f2\u60a0\u4e45\uff0c\u529f\u80fd\u5f3a\u5927\u7684\u56fe\u7247\u6216\u6587\u5b57\u7b49\u5217\u8868\u5185\u5bb9\u6eda\u52a8\u5207\u6362\u663e\u793a\u7684\u63d2\u4ef6\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\u6eda\u52a8\u5207\u6362\u663e\u793a\u63d2\u4ef6\" class=\"mt10\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/200912\/2009-12-25_102449.jpg\" title=\"\u56fe\u7247\u6eda\u52a8\u5207\u6362\u663e\u793a\u63d2\u4ef6\" class=\"alignnone\" width=\"350\" height=\"135\" \/><\/p>\n<p>\u4ee5\u4e0b\u662f\u5173\u4e8e\u6b64\u63d2\u4ef6\u7684\u4e00\u4e9b\u8bb2\u89e3\u4e0e\u8bf4\u660e\u3002<\/p>\n<style type=\"text\/css\">\nh3{margin:15px 0 0;}\n.entry li{margin-bottom:4px;}\n<\/style>\n<h3>jCarousel &#8211; jQuery\u4e0b\u7684\u6eda\u52a8\u5207\u6362\u4f20\u9001\u63d2\u4ef6<\/h3>\n<div id=\"link\" class=\"mt10\">\n  \t<strong>\u7ffb\u8bd1:<\/strong> <a href=\"http:\/\/www.zhangxinxu.com\">\u5f20\u946b\u65ed<\/a><br \/>\n  \t<strong>\u4f5c\u8005:<\/strong> <a href=\"http:\/\/sorgalla.com\">Jan Sorgalla<\/a><br \/>\n    <strong>\u7248\u672c:<\/strong> 0.2.3 (<a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/changelog.html\">\u66f4\u65b0\u65e5\u5fd7<\/a>)<br \/>\n    <strong>\u4e0b\u8f7d:<\/strong> <a href=\"http:\/\/sorgalla.com\/projects\/download.php?jcarousel\">jcarousel.tar.gz<\/a>\u6216<a href=\"http:\/\/sorgalla.com\/projects\/download-zip.php?jcarousel\">jcarousel.zip<\/a>(\u82f1\u6587\u539f\u7248)\uff0c\u6216\u662f<a href=\"http:\/\/www.zhangxinxu.com\/study\/down\/jcarousel_zh.zip\">jcarousel_zh.zip<\/a>(\u4e2d\u6587\u7248)<br \/>\n    <strong>\u8bb8\u53ef:<\/strong> <a href=\"http:\/\/www.opensource.org\/licenses\/mit-license.php\">MIT<\/a> \u548c <a href=\"http:\/\/www.opensource.org\/licenses\/gpl-license.php\">GPL<\/a> \u53cc\u6388\u6743\u8bb8\u53ef\u3002\n    <\/div>\n<p>  <a name=\"Contents\"><\/a><\/p>\n<h3>\u4e00\u3001\u5185\u5bb9 &#8211; \u76ee\u5f55<\/h3>\n<ol>\n<li><a href=\"#Introduction\">\u4ecb\u7ecd<\/a><\/li>\n<li><a href=\"#Examples\">\u793a\u4f8b<\/a><\/li>\n<li><a href=\"#Getting-Started\">\u5165\u95e8\u6307\u5357<\/a><\/li>\n<li><a href=\"#Dynamic-Content-Loading\">\u52a8\u6001\u5185\u5bb9\u52a0\u8f7d<\/a><\/li>\n<li><a href=\"#Configuration\">\u914d\u7f6e<\/a><\/li>\n<li><a href=\"#Compatibility\">\u517c\u5bb9\u6027<\/a><\/li>\n<li><a href=\"#Credits\">\u81f4\u8c22<\/a><\/li>\n<\/ol>\n<div><a name=\"Introduction\"><\/a><\/div>\n<h3>\u4e8c\u3001\u7b80\u8981\u4ecb\u7ecd<\/h3>\n<p>jCarousel\u662f\u4e00\u6b3e <a href=\"http:\/\/jquery.com\">jQuery<\/a> \u63d2\u4ef6\uff0c \u7528\u6765\u63a7\u5236\u6c34\u5e73\u6216\u5782\u76f4\u6392\u5217\u7684\u5217\u8868\u9879. \u8fd9\u4e9b\u9879\u76ee\uff08\u53ef\u4ee5\u662f\u9759\u6001HTML\u5185\u5bb9\u6216\u662fAjax\u52a0\u8f7d\u5185\u5bb9\uff09\u5185\u5bb9\u662f\u53ef\u4ee5\u6765\u56de\u6eda\u52a8\u7684\uff08\u53ef\u4ee5\u6709\u52a8\u753b\u6548\u679c\uff09\u3002<\/p>\n<div><a name=\"Examples\"><\/a><\/div>\n<h3>\u4e09\u3001demo\u5b9e\u4f8b\u9875\u9762\u4eec<\/h3>\n<p>\u4e0b\u9762\u7684\u4e00\u4e9b\u5b9e\u4f8b\u9875\u9762\u5c55\u793a\u4e86jCarousel\u63d2\u4ef6\u53ef\u80fd\u7684\u6f5c\u529b:<\/p>\n<div>\n<div class=\"f11\"><strong>\u9759\u6001\u5b9e\u4f8b<\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_simple.html\">\u6700\u7b80\u5355\u57fa\u672c\u7684\u6eda\u52a8\u5207\u6362\u6548\u679c<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_vertical.html\">\u5782\u76f4\u6eda\u52a8\u5207\u6362<\/a> <\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_auto.html\">\u81ea\u52a8\u6eda\u52a8\u7684\u4f20\u9001\u5207\u6362<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_callbacks.html\">\u542b\u56de\u8c03\u51fd\u6570\u7684\u6eda\u52a8\u5207\u6362\u4e3e\u4f8b<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_controls.html\">\u542b\u5916\u90e8\u63a7\u5236\u7684\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_start.html\">\u6709\u81ea\u5b9a\u4e49\u8d77\u59cb\u4f4d\u7f6e\u7684\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/static_multiple.html\">\u4e00\u4e2a\u9875\u9762\u4e0a\u540c\u65f6\u51fa\u73b0\u591a\u4e2a\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<\/ul>\n<div class=\"f11\"><strong>\u52a8\u6001\u5b9e\u4f8b<\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/dynamic_javascript.html\">\u901a\u8fc7JavaScript\u52a0\u8f7d\u6eda\u52a8\u5207\u6362\u7684\u52a8\u6001\u5185\u5bb9<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/dynamic_ajax.html\">\u901a\u8fc7Ajax\u52a0\u8f7d\u6eda\u52a8\u5207\u6362\u7684\u52a8\u6001\u5185\u5bb9<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/dynamic_ajax_php.html\">\u901a\u8fc7Ajax\u4ecePHP\u811a\u672c\u52a0\u8f7d\u6eda\u52a8\u5207\u6362\u7684\u52a8\u6001\u5185\u5bb9<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/dynamic_flickr_feed.html\">\u901a\u8fc7Ajax\u4eceFlickr\u7167\u7247\u8ba2\u9605\u4e2d\u52a0\u8f7d\u6eda\u52a8\u5207\u6362\u7684\u52a8\u6001\u5185\u5bb9<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/dynamic_flickr_api.html\">\u901a\u8fc7Ajax\u4eceFlickr API\u4e2d\u52a0\u8f7d\u6eda\u52a8\u5207\u6362\u7684\u52a8\u6001\u5185\u5bb9<\/a><\/li>\n<\/ul>\n<div class=\"f11\"><strong>\u7279\u522b\u7684\u5b9e\u4f8b<\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/special_circular.html\">\u5faa\u73af\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/special_textscroller.html\">\u4f7f\u7528jCarousel\u8fdb\u884c\u6587\u672c\u6eda\u52a8<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/special_flexible.html\">\u66f4\u7075\u6d3b\u7684\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/special_thickbox.html\">jCarousel \u548c Thickbox 3\u63d2\u4ef6\u76f8\u7ed3\u5408<\/a><\/li>\n<li><a href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/examples\/special_easing.html\">\u542b\u81ea\u5b9a\u4e49\u52a8\u753b\u6548\u679c\u7684\u6eda\u52a8\u5207\u6362<\/a><\/li>\n<\/ul><\/div>\n<div><a name=\"Getting-Started\"><\/a><\/div>\n<h3>\u56db\u3001\u5165\u95e8\u6307\u5357<\/h3>\n<p>\u60f3\u8981\u4f7f\u7528\u8fd9\u6b3ejCarousel\u7ec4\u4ef6\uff0c\u9700\u8981include <a href=\"http:\/\/jquery.com\">jQuery<\/a>\u5e93\uff0c jCarousel\u8d44\u6e90\u6587\u4ef6, jCarousel core \u6838\u5fc3\u6837\u5f0f\u8868\u6587\u4ef6\u4ee5\u53cajCarousel\u76ae\u80a4\u6837\u5f0f\u8868\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u5728\u60a8\u7684HTML\u6587\u6863<code>&lt;head&gt;<\/code>\u6807\u7b7e\u4e4b\u5185\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;\/path\/to\/jquery-1.2.1.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;\/path\/to\/lib\/jquery.jcarousel.pack.js&quot;&gt;&lt;\/script&gt;\r\n&lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;\/path\/to\/lib\/jquery.jcarousel.css&quot; \/&gt;\r\n&lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;\/path\/to\/skin\/skin.css&quot; \/&gt;\r\n<\/pre>\n<\/div>\n<p>\u4e0b\u8f7d\u6587\u4ef6\u5305\u4e2d\u5305\u542b\u51e0\u6b3e\u6253\u5305\u7684\u793a\u4f8b\u76ae\u80a4\u3002\u60a8\u53ef\u4ee5\u81ea\u7531\u7684\u5728\u8fd9\u4e9b\u76ae\u80a4\u4e0a\u5efa\u7acb\u5c5e\u4e8e\u60a8\u81ea\u5df1\u7684\u76ae\u80a4\u3002<\/p>\n<p>jCarousel\u671f\u671b\u5728\u60a8\u7684HTML\u6587\u6863\u4e2d\u80fd\u6709\u4e00\u4e2a\u975e\u5e38\u57fa\u672c\u7684HTML\u6807\u8bb0\u7ed3\u6784\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;ul id=&quot;mycarousel&quot; class=&quot;jcarousel-skin-<em>name<\/em>&quot;&gt\r\n   &lt;!-- The content goes in here --&gt;\r\n&lt;\/ul&gt;\r\n<\/pre>\n<\/div>\n<p>jCarousel\u53ef\u4ee5\u81ea\u52a8\u5305\u62ec\u5728\u5217\u8868\u5916\u90e8\u7684\u9700\u8981\u7684HTML\u6807\u8bb0\u3002\u8fd9\u4e2aclass\u53c2\u6570\u662f\u5c06jCarousel\u76ae\u80a4<em>\u201c\u540d\u79f0\u201d<\/em>\u5e94\u7528\u4e8e\u6eda\u52a8\u5207\u6362\u4e0a\u3002<\/p>\n<p>\u4e3a\u4e86\u8bbe\u7f6ejCarousel, \u5728\u60a8\u7684HTML\u6587\u6863\u7684<code>&lt;head&gt;<\/code>\u6807\u7b7e\u5185\u90e8\u6dfb\u52a0\u5982\u4e0b\u7684\u4ee3\u7801\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\njQuery(document).ready(function() {\r\n    jQuery('#mycarousel').jcarousel({\r\n        \/\/ Configuration goes here\r\n    });\r\n});\r\n&lt;\/script&gt;\r\n<\/pre>\n<\/div>\n<p>jCarousel\u63a5\u53d7\u5f88\u591a\u7684\u914d\u7f6e\u9009\u9879\uff0c\u60a8\u53ef\u4ee5\u53bb\u201c<a href=\"#Configuration\">\u914d\u7f6e<\/a>\u201d\u6bb5\u843d\u67e5\u770b\u66f4\u591a\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u5728jCarousel\u88ab\u521d\u59cb\u5316\u4e4b\u540e\uff0cDOM\u4e2d\u5b8c\u6574\u7684\u521b\u5efa\u7684\u6807\u8bb0\u662f\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;div class=&quot;jcarousel-skin-<em>name<\/em>&quot;&gt;\r\n  &lt;div class=&quot;jcarousel-container&quot;&gt;\r\n    &lt;div disabled=&quot;disabled&quot; class=&quot;jcarousel-prev jcarousel-prev-disabled&quot;&gt;&lt;\/div&gt;\r\n    &lt;div class=&quot;jcarousel-next&quot;&gt;&lt;\/div&gt;\r\n    &lt;div class=&quot;jcarousel-clip&quot;&gt;\r\n      &lt;ul class=&quot;jcarousel-list&quot;&gt;\r\n        &lt;li class=&quot;jcarousel-item-1&quot;&gt;First item&lt;\/li&gt;\r\n        &lt;li class=&quot;jcarousel-item-2&quot;&gt;Second item&lt;\/li&gt;\r\n      &lt;\/ul&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<\/div>\n<p>\u6b63\u5982\u60a8\u770b\u5230\u7684\uff0c\u6709\u4e9b\u5143\u7d20\u6dfb\u52a0\u4e86\u4e00\u4e9b\u6307\u5b9a\u7684class\uff08\u60a8\u624b\u52a8\u6307\u5b9a\u7684class\u9664\u5916\uff09\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u4e0a\u9762\u60a8\u770b\u5230\u7684\u4e9b\u6837\u5f0f\u8bbe\u8ba1\u60a8\u81ea\u5df1\u7684\u6eda\u52a8\u5207\u6362\u7684\u8868\u73b0\u3002<\/p>\n<h4>\u6ce8\u610f\uff1a<\/h4>\n<ul>\n<li>\u76ae\u80a4class &quot;jcarousel-skin-<em>name&quot;<\/em> \u5df2\u7ecf\u4ece<code>&lt;ul&gt;<\/code>\u79fb\u5230\u7684\u9876\u90e8\u7684<code>&lt;div&gt;<\/code>\u5143\u7d20\u4e0a\u4e86\u3002<\/li>\n<li>\u5b9e\u4f8b\u4e2d\uff0c<code>&lt;div class=&quot;jcarousel-container&quot;&gt;<\/code>\u4e0b\u7b2c\u4e00\u4e2a\u5d4c\u5957\u7684<code>&lt;div&gt;<\/code>\u662f\u4e2a\u4e0d\u53ef\u7528\u7684\u6309\u94ae\uff0c\u7b2c\u4e8c\u4e2a\u53ef\u7528\u3002\u8fd9\u4e2a\u4e0d\u53ef\u4f7f\u7528\u7684\u6309\u94ae\u6709\u4e2adisabled\u5c5e\u6027\uff08\u5bf9\u4e8e<code>&lt;div&gt;<\/code>\u800c\u8a00\u6709\u4e9b\u4e0d\u5408\u7406\uff0c\u4f46\u662f\u60a8\u53ef\u4ee5\u4f7f\u7528<code>&lt;button&gt;<\/code>\u5143\u7d20\u6216\u8005\u5176\u4ed6\u60a8\u60f3\u8981\u7684\u5143\u7d20\uff09\u548c\u9644\u52a0\u7684class\u7c7b<code>jcarousel-prev-disabled<\/code>\u6216\uff08<code>jcarousel-next-disabled<\/code>\uff09\u3002<\/li>\n<li>\u5217\u8868\u4e2d\u6bcf\u4e2a<code>&lt;li&gt;<\/code>\u5143\u7d20\u90fd\u6709<code><\/code><code>jcarousel-item-<em>n<\/em><\/code>\u8fd9\u4e2a\u7279\u5b9a\u7684class\u3002\u5176\u4e2d\u8fd9\u4e2a<code><em>n<\/em><\/code>\u4ee3\u8868\u4e86\u5f53\u524d\u5143\u7d20\u5728\u5217\u8868\u4e2d\u7684\u4f4d\u7f6e<\/li>\n<li>\u8fd9\u91cc\u6ca1\u6709\u663e\u793a\u7684\u662f\uff0c\u6240\u6709class\u7c7b\u540e\u9762\u9644\u52a0\u7684\u540e\u7f00\u662f\u7531\u6eda\u52a8\u5207\u6362\u7684\u65b9\u5411\u51b3\u5b9a\u7684\u3002\u4f8b\u5982\uff1a <code>&lt;ul class=&quot;jcarousel-list<br \/>\n      jcarousel-list-horizontal&quot;&gt;<\/code>\u8868\u6c34\u5e73\u65b9\u5411\u4e0a\u7684\u4f20\u9001\u5207\u6362\u3002<\/li>\n<\/ul>\n<div><a name=\"Dynamic-Content-Loading\"><\/a><\/div>\n<h3>\u4e94\u3001\u52a8\u6001\u5185\u5bb9\u52a0\u8f7d<\/h3>\n<p>\u901a\u8fc7<code>itemLoadCallback<\/code>\u7684\u56de\u8c03\u51fd\u6570\u4f5c\u4e3a\u914d\u7f6e\u9009\u9879\uff0c\u4f60\u53ef\u4ee5\u52a8\u6001\u5730\u521b\u5efa<code>&lt;li&gt;<\/code>\u9879\u6dfb\u52a0\u5230\u5185\u5bb9\u4e2d\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\njQuery(document).ready(function() {\r\n    jQuery('#mycarousel').jcarousel({\r\n        itemLoadCallback: itemLoadCallbackFunction\r\n    });\r\n});\r\n&lt;\/script&gt;<\/pre>\n<\/div>\n<p><code>itemLoadCallbackFunction<\/code> \u662f\u4e00\u4e2aJavaScript\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u5728\u6eda\u52a8\u5207\u6362\u9700\u8981\u7684\u4e9b\u9009\u9879\u5373\u5c06\u88ab\u52a0\u8f7d\u5b8c\u6bd5\u7684\u65f6\u5019\u8c03\u7528\u3002\u4f20\u9012\u4e86\u4e24\u4e2a\u53c2\u6570\uff1a\u8bf7\u6c42\u7684\u6eda\u52a8\u5207\u6362\u5b9e\u4f8b\u53c2\u6570\u548c\u663e\u793a\u5f53\u524d\u6eda\u52a8\u5207\u6362\u72b6\u6001\u7684\u6807\u5fd7(&#8216;init&#8217;, &#8216;prev&#8217; \u6216 &#8216;next&#8217;)\u53c2\u6570\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\nfunction itemLoadCallbackFunction(carousel, state)\r\n{\r\n    for (var i = carousel.first; i &lt;= carousel.last; i++) {\r\n        \/\/ Check if the item already exists\r\n        if (!carousel.has(i)) {\r\n            \/\/ Add the item\r\n            carousel.add(i, &quot;I'm item #&quot; + i);\r\n        }\r\n    }\r\n};\r\n&lt;\/script&gt;<\/pre>\n<\/div>\n<p>jCarousel\u5305\u542b\u4e00\u4e2a\u5f88\u65b9\u4fbf\u7684\u65b9\u6cd5<code>add()<\/code>\uff0c\u8fd9\u4e2a\u73a9\u610f\u53ef\u4ee5\u521b\u5efa\u5217\u8868\u9879\u4ee5\u53ca\u6bcf\u4e2a\u9879\u4e2d\u7684innerHTML\u5b57\u7b26\u4e32\u3002\u5982\u679c\u5f53\u524d\u9879\u5df2\u7ecf\u5b58\u5728\uff0c\u5219\u6b64\u65b9\u6cd5\u4ec5\u4ec5\u66f4\u65b0innerHTML\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u516c\u5171\u53d8\u91cf<code>carousel.first<\/code>\u548c<code>carousel.last<\/code>\u4f7f\u7528\u7b2c\u4e00\u4e2a\u548c\u6700\u540e\u4e00\u4e2a\u53ef\u89c1\u9879\u3002\n  <\/p>\n<div><a name=\"Configuration\"><\/a><\/div>\n<h3>\u516d\u3001\u914d\u7f6e<\/h3>\n<p> jCarousel\u63a5\u53d7\u4e00\u7cfb\u5217\u7684\u53c2\u6570\u6765\u63a7\u5236\u6eda\u52a8\u5207\u6362\u4f20\u9001\u5e26\u7684\u5916\u89c2\u548c\u884c\u4e3a\u3002\u7bc7\u5e45\u539f\u56e0\uff0c\u5177\u4f53\u53c2\u6570\u8bf7\u770b\u8fd9\u91cc\uff1a <a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/jq\/jcarousel_zh\/#Configuration\">\u914d\u7f6e\u53c2\u6570\u4fe1\u606f<\/a><\/p>\n<div><a name=\"Compatibility\"><\/a><\/div>\n<h3>\u4e03\u3001\u517c\u5bb9\u6027<\/h3>\n<p>jCarousel\u5df2\u7ecf\u5728\u4e0b\u5217\u6d4f\u89c8\u5668\u4e0b\u6d4b\u8bd5\u901a\u8fc7\uff1a<\/p>\n<ul>\n<li>Internet Explorer 6 (PC)<\/li>\n<li>Internet Explorer 7 (PC)<\/li>\n<li>FireFox 1.5.0.6 (PC\/Mac\/Linux)<\/li>\n<li>Opera 9.01 (PC\/Mac)<\/li>\n<li>Safari 2.0.4 (Mac)<\/li>\n<li>Safari 3.1.0 (PC)<\/li>\n<li>Konqueror 3.4.0 (Linux)<\/li>\n<\/ul>\n<div><a name=\"Credits\"><\/a><\/div>\n<h3>\u516b\u3001\u81f4\u8c22<\/h3>\n<p>\u611f\u8c22<a href=\"http:\/\/ejohn.org\">John Resig<\/a> \u548c\u4ed6\u7684\u4e0d\u53ef\u601d\u8bae\u7684<a href=\"http:\/\/jquery.com\">jQuery<\/a>\u5e93\u3002<br \/>\n    jCarousel\u7684\u7075\u611f\u6765\u81ea<a href=\"http:\/\/billwscott.com\/carousel\/\">Carousel Component<\/a>\uff0c\u7531<a href=\"http:\/\/looksgoodworkswell.com\">Bill Scott<\/a>\u4e66\u5199\u3002<\/p>\n<h3>\u4e5d\u3001\u6700\u540e\u4e00\u70b9\u4f5c\u8005\u7684\u8bdd<\/h3>\n<p>\u7ffb\u8bd1\u6c34\u5e73\u6709\u9650\uff0c\u5982\u679c\u4e0d\u51c6\u786e\u7684\u5730\u65b9\u6b22\u8fce\u6307\u51fa\u3002\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/down\/jcarousel_zh.zip\">\u4e2d\u6587\u7ffb\u8bd1\u5b8c\u6574demo<\/a>(136K)<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea<a href=\"http:\/\/www.zhangxinxu.com\/\">\u5f20\u946b\u65ed-\u946b\u7a7a\u95f4-\u946b\u751f\u6d3b<\/a>[<a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a>]<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=477\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=477<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\u6eda\u52a8\u5207\u6362\u663e\u793a\u63d2\u4ef6\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/200912\/2009-12-25_102449.jpg\" title=\"\u56fe\u7247\u6eda\u52a8\u5207\u6362\u663e\u793a\u63d2\u4ef6\" class=\"alignnone\" width=\"350\" height=\"135\" \/><br \/>\njCarousel\u662f\u4e00\u6b3e\u5386\u53f2\u60a0\u4e45\uff0c\u529f\u80fd\u5f3a\u5927\u7684\u56fe\u7247\u6216\u6587\u5b57\u7b49\u5217\u8868\u5185\u5bb9\u6eda\u52a8\u5207\u6362\u663e\u793a\u63d2\u4ef6\u3002\u53ef\u4ee5\u81ea\u5b9a\u4e49\u76ae\u80a4\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u663e\u793a\u7684\u65b9\u5411\uff0c\u53ef\u4ee5\u4ece\u5916\u90e8\u63a7\u5236\u6bcf\u6b21\u5207\u6362\u663e\u793a\u7684\u5143\u7d20\u7684\u4e2a\u6570\uff0c\u52a8\u753b\u7684\u65f6\u95f4\u7b49\u3002\u53ef\u4ee5\u5207\u6362\u4efb\u4f55\u5f62\u5f0f\u7684\u6570\u636e\uff0c\u9759\u6001\u7684HTML\uff0c\u52a8\u6001\u7684\u6587\u672c\u6570\u636e\uff0cJavaScript\u6570\u636e\uff0cAjax\u8bf7\u6c42\u7684XML\u6570\u636e\uff0cJSON\uff0cfeed\u8ba2\u9605\u6570\u636e\u7b49\uff0c\u90fd\u53ef\u4ee5\u5207\u6362\u663e\u793a\u3002\u4f18\u70b9\u771f\u662f\u5f88\u591a\u3002\u7f51\u4e0a\u63a8\u8350\u8fd9\u6b3e\u63d2\u4ef6\u7684\u6587\u7ae0\u4e0d\u5c11\uff0c\u4f46\u662f\u771f\u6b63\u597d\u597d\u7814\u7a76\u8fd9\u4e2a\u63d2\u4ef6\u7684\u6587\u7ae0\u5c31\u5f88\u5c11\u3002\u6211\u4ece\u6628\u665a10\u70b9\u4e00\u76f4\u5230\u73b0\u5728\uff0c\u8fde\u7eed\u594b\u621810\u591a\u4e2a\u5c0f\u65f6\u7ec8\u4e8e\u5b8c\u6210\u4e86\u8fd9\u6b3e\u63d2\u4ef6\u7684\u6e90\u6587\u4ef6\u8bb2\u89e3\u53ca\u5168\u90e8demo\u4e3a\u4e2d\u6587\u7ffb\u8bd1\u3002<br \/>\n\u5728\u8fd9\u7bc7\u6587\u7ae0\u91cc\uff0c\u60a8\u4f1a\u770b\u5230\u4e2d\u6587\u7ffb\u8bd1\u540e\u7684\u63d2\u4ef6\u4f7f\u7528\u7b49\u8be6\u5c3d\u7684\u4ecb\u7ecd\uff0c\u63d0\u4f9b\u4e00\u4e00\u5bf9\u5e94\u7684\u4e2d\u6587\u7248demo\u9875\u9762\uff0c\u63d0\u4f9b\u4e2d\u6587\u7248\u7684\u6e90\u6587\u4ef6\u4e0b\u8f7d\u3002\u5e0c\u671b\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[214,280,279,14,213,68,50,265,124,223],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/477"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=477"}],"version-history":[{"count":1,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":11580,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/477\/revisions\/11580"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}