{"id":6,"date":"2007-08-09T09:37:55","date_gmt":"2007-08-09T09:37:55","guid":{"rendered":"http:\/\/gmarwaha.com\/blog\/?p=6"},"modified":"2014-10-06T12:58:17","modified_gmt":"2014-10-06T12:58:17","slug":"jcarousel-lite-a-jquery-plugin","status":"publish","type":"post","link":"https:\/\/www.gmarwaha.com\/blog\/2007\/08\/09\/jcarousel-lite-a-jquery-plugin\/","title":{"rendered":"jCarousel Lite &#8211; A jQuery plugin"},"content":{"rendered":"<p><a href=\"http:\/\/www.gmarwaha.com\/jquery\/jcarousellite\/index.php\" style=\"display: block;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1231 aligncenter\" src=\"http:\/\/www.gmarwaha.com\/blog\/wp-content\/uploads\/2007\/08\/jcarousellite-img-02.png\" alt=\"jcarousellite-img-02\" width=\"554\" height=\"171\" srcset=\"https:\/\/www.gmarwaha.com\/blog\/wp-content\/uploads\/2007\/08\/jcarousellite-img-02.png 554w, https:\/\/www.gmarwaha.com\/blog\/wp-content\/uploads\/2007\/08\/jcarousellite-img-02-300x92.png 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><\/p>\n<p><a title=\"jCarouselLite Demo Page\" href=\"http:\/\/www.gmarwaha.com\/jquery\/jcarousellite\/index.php\" target=\"_blank\">jCarousel Lite<\/a> is a <a href=\"http:\/\/jquery.com\">jQuery<\/a> plugin that carries you on a carousel ride filled with images and HTML content. Put simply, you can navigate images and\/or HTML in a carousel-style widget. It is super light weight, at about <em>2 KB in size<\/em>, yet very flexible and customizable to fit most of our needs.<\/p>\n<div class=\"alert alert-success\"><strong>Did I mention that it weighs just 2 KB?<\/strong><\/div>\n<p>As if that wasn&#8217;t enough, the best part is yet to come&#8230; You don&#8217;t need any special css file or class name to get this to work. Include the js file. Supply the HTML markup. Then, construct the carousel with just a simple function call.<\/p>\n<p>Visit the <a title=\"jCarousel Lite Project Page\" href=\"http:\/\/www.gmarwaha.com\/jquery\/jcarousellite\/index.php\">project<\/a> page for more information. There you can find a lot of <a title=\"jCarousel Lite Demo Page\" href=\"http:\/\/www.gmarwaha.com\/jquery\/jcarousellite\/demo.php\">demos<\/a> and exhaustive documentation. This blog entry is just a teaser for further exploration.<\/p>\n<p>Installing and getting it to work is as trivial as following the 3 steps given below&#8230;<\/p>\n<h4>Step 1:<\/h4>\n<p>Include a reference to the jQuery library and the <code>jCarouselLite<\/code> plugin. You can download <a href=\"http:\/\/jquery.com\">jQuery here<\/a> and <a href=\"\/jquery\/jcarousellite\/download.php\">jCarouselLite here<\/a>. If you like interesting effects, include the <a href=\"http:\/\/gsgd.co.uk\/sandbox\/jquery\/easing\/\">Easing plugin<\/a> as well (Optional). You may also want to use a <a href=\"http:\/\/gsgd.co.uk\/sandbox\/jquery\/easing\/\">compatibility easing plugin<\/a> if you want to use old easing names. If you would like to navigate the carousel using mouse wheel, then include the <a href=\"https:\/\/github.com\/brandonaaron\/jquery-mousewheel\">mouse-wheel plugin<\/a> as well (Optional).<\/p>\n<pre class=\"prettyprint\">&lt;script type=\"text\/javascript\" src=\"path\/to\/jquery.js\"&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\" src=\"path\/to\/jquery.jcarousellite.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;!-- Optional --&gt;\r\n&lt;script type=\"text\/javascript\" src=\"path\/to\/easing.js\"&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\" src=\"path\/to\/mousewheel.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<h4>Step 2:<\/h4>\n<p>In your HTML file, provide the markup required by the carousel (a <code>div<\/code> enclosing an <code>ul<\/code>). You also need the navigation buttons, but these buttons need not be part of the carousel markup itself. An example follows&#8230;<\/p>\n<pre class=\"prettyprint\">&lt;button class=\"prev\"&gt;&amp;laquo;&lt;\/button&gt;\r\n&lt;button class=\"next\"&gt;&amp;raquo;&lt;\/button&gt;\r\n\r\n&lt;div class=\"any-class\"&gt;\r\n    &lt;ul&gt;\r\n        &lt;li&gt;&lt;img src=\"image\/1.jpg\" style=\"width:150px; height:118px;\"&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;img src=\"image\/2.jpg\" style=\"width:150px; height:118px;\"&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;img src=\"image\/3.jpg\" style=\"width:150px; height:118px;\"&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;img src=\"image\/4.jpg\" style=\"width:150px; height:118px;\"&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;img src=\"image\/5.jpg\" style=\"width:150px; height:118px;\"&gt;&lt;\/li&gt;\r\n    &lt;\/ul&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<h4>Step 3:<\/h4>\n<p>Fire a call to the plugin and supply your navigation buttons. You just managed to architect your own carousel.<\/p>\n<pre class=\"prettyprint\">$(function() {\r\n    $(\".any-class\").jCarouselLite({\r\n        btnNext: \".next\",\r\n        btnPrev: \".prev\"\r\n    });\r\n});\r\n<\/pre>\n<p>If you have any comments\/suggestions\/requests, feel free to drop in a comment or reach @ganeshmax in twitter.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"update\">\n<h4>Update<\/h4>\n<p>Based on popular request, jCarouselLite has been updated to support jquery 1.2.x versions. Goto the <a title=\"jCarouselLite Download Page\" href=\"http:\/\/www.gmarwaha.com\/jquery\/jcarousellite\/download.php\">download page<\/a> and download version 1.0.1 to enjoy jquery 1.2.x support. Since Firefox 3 has some issues with $(document).ready() function, try using $(window).load() instead if you face any problems. Hopefully a future version of Firefox or jQuery will fix the problem.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>jCarousel Lite is a jQuery plugin that carries you on a carousel ride filled with images and HTML content. Put simply, you can navigate images and\/or HTML in a carousel-style widget. It is super light weight, at about 2 KB in size, yet very flexible and customizable to fit most of our needs. Did I mention that it weighs just 2 KB? As if that wasn&#8217;t enough, the best part is yet to come&#8230; You don&#8217;t need any special css file or class name to get this to work. Include the js file. Supply the HTML markup. Then, construct the... <br \/><a class=\"moretag\" href=\"https:\/\/www.gmarwaha.com\/blog\/2007\/08\/09\/jcarousel-lite-a-jquery-plugin\/\">Continue reading...<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4,8],"tags":[],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-client-side","category-javascript","category-jquery"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":11,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":1233,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/posts\/6\/revisions\/1233"}],"wp:attachment":[{"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gmarwaha.com\/blog\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}