Thursday, March 10, 2011

Moving jquery image slider for featured content in Blogger

In this blogger tutorial you will learn how you can insert auto move jquery image slider/featured content which is also known as carousel to blogger blog.You can see this jquery image slider implemented at the top of my blog.Some of my blog readers are asking me through email that how they can insert it in their blog so i decided to share it with my readers.It is an excellent way to make your blog attractive and user friendly because you can show your best content in it and your blog readers will stay on your blog for long time.Now just follow the below procedure step by step.

Also read Add Beautiful jQuery Auto-Playing Featured Content Image Slider to Blogger .

Backup template

Firstly backup your template so you can revert back any changes to the template in case of errors.
Go to Layout > Edit HTML and click on " Download Full Template".


After saving your template,check  "Expand widget templates" and insert the below css styling before ]]></b:skin>.

background:#000 url( repeat-x;
width: 650px;

position: relative; /*leave this value alone*/
overflow: scroll; /*leave this value alone*/
width: 554px; /*Width of Carousel Viewer itself*/
height: 160px; /*Height should enough to fit largest content's height*/
margin: 0px 48px 5px 48px;


.stepcarousel .belt{
position: absolute; /*leave this value alone*/
left: 0;
top: 0;

.stepcarousel .panel{
float: left; /*leave this value alone*/
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
margin: 20px 10px ; /*margin around each panel*/
width:170px; /*Width of each panel holding each content. If removed, widths should be individually defined on each content DIV then. */
border:1px solid #1d2c44;

.stepcarousel .panel p{
text-align: left; /*leave this value alone*/
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
margin: 5px 5px ; /*margin around each panel*/


.stepcarousel .panel h2{
text-align: left; /*leave this value alone*/
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
margin: 2px 5px ; /*margin around each panel*/
font-family:Georgia,century gothic,Arial,verdana, sans-serif;

.stepcarousel .panel img{
float: left; /*leave this value alone*/
background:#0E1829; /*clip content that go outside dimensions of holding panel DIV*/
margin: 5px 5px 5px 5px; /*margin around each panel*/
padding:0px 0px;
The red highlighted text in above code is the background image of the slider which is black but you can change the color of background according to your blog colors.You can use Google images to find background colors suitable for blog and after uploading that image to image hosting you can replace above link with yours.
Now using "Ctrl + F" find  /head in the template code and add below code before it.
<!-- JavaScript Slider -->
<script src='' type='text/javascript'/>
<script src='' type='text/javascript'/>

<!-- End JavaScript Slider -->
<script type='text/javascript'>
galleryid: &#39;mygallery&#39;, //id of carousel DIV
beltclass: &#39;belt&#39;, //class of inner &quot;belt&quot; DIV containing all the panel DIVs
panelclass: &#39;panel&#39;, //class of panel DIVs each holding content
panelbehavior: {speed:1500, wraparound:true, persist:true},
autostep: {enable:true, moveby:1pause:1000},
defaultbuttons: {enable: true, moveby: 4, leftnav: [&#39;;, -48, 0], rightnav: [&#39;;, 0, 0]},
statusvars: [&#39;statusA&#39;, &#39;statusB&#39;, &#39;statusC&#39;], //register 3 variables that contain current panel (start), current panel (last), and total panels
contenttype: [&#39;external&#39;] //content setting [&#39;inline&#39;] or [&#39;external&#39;, &#39;path_to_external_file&#39;]


The highlighted red lines in above script are right and left sliding arrows images which can also be changed.The green highlighted texts are different attributes of the slider like speed of the carousel ,how many images to "moveby" when clicking on arrows.
The difficult part is almost finished just save your template.
Go to Layout > Page Elements Add A Gadget > Html /Javascript and insert the below code in the Gadget.

<div id="myslides">
<div id="mygallery" class="stepcarousel">
<div class="belt">

<!-- 1st Template -->
<div class='panel'>
<a href='' target='blank' title='Made in Spain'> <img alt='Made in Spain' height='135' src='' width='185'/> </a>
<!--end code of 1st Template -->
<!-- 2nd Template -->

<div class='panel'>
<a href='' target='blank' title='Fashion Press'> <img alt='Fashion Press' height='135' src='' width='185'/> </a>

<!--end code of 2nd Template -->

<!-- 3rd Template -->

<div class='panel'>
<a href='' target='blank' title='Techlure'> <img alt='Techlure' height='135' src='' title='Techlure' width='185'/> </a>
<!--end code of 3rd Template -->
<!-- 4th Template -->

<div class='panel'>
<a href='' target='blank' title='Woodmag'> <img alt='Woodmag' height='135' src='' title='Techlure' width='185'/> </a>
<!--end code of 4th Template -->
<!-- 5th Template -->

<div class='panel'>
<a href='' target='blank' title='Showcase'> <img alt='Showcase' height='135' src='' title='Showcase' width='185'/> </a>
<!--end code of 5th Template -->
<!-- 6th Template -->

<div class='panel'>
<a href='' target='blank' title='Versatile'> <img alt='Versatile' height='135' src='' title='Versatile' width='185'/> </a>
<!--end code of 6th Template -->

Replace my images and post links with yours and save it.You can add as many posts in carousel as you like but do not add too much posts because it will increase the loading time of your blog.
I tried my best to help you install carousel in your blog but if you are still facing problems please mention it in comments and i will see what i can do to solve your problem.


Post a Comment


Blogumulus by Roy Tanck and Amanda Fazani
Free Blogger Tips, Hacks, Widgets, Templates and more