Thursday, March 10, 2011

Moving jquery image slider for featured content in Blogger

5 comments
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".



Installation

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

background:#000 url(http://1.bp.blogspot.com/_xfdD6S9fOk4/Sd1SjSaUrXI/AAAAAAAAA20/ndvDf0nTslY/s1600/mslid.jpg) repeat-x;
width: 650px;
height:165px;
margin-bottom:5px;
}

.stepcarousel{
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. */
background:#0e1829;
height:120px;
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*/
height:20px;
overflow: hidden; /*clip content that go outside dimensions of holding panel DIV*/
margin: 2px 5px ; /*margin around each panel*/
font-size:16px;
font-weight:bold;
text-align:center;
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='http://www.yourjavascript.com/57180121136/jquery-1.3.2.js' type='text/javascript'/>
<script src='http://www.yourjavascript.com/30111191622/slider.js' type='text/javascript'/>

<!-- End JavaScript Slider -->
<script type='text/javascript'>
stepcarousel.setup({
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;http://1.bp.blogspot.com/_v5IxGTiMTD8/SxOlAIA_ZZI/AAAAAAAAAfg/ELVwF1qY8M8/s400/left.jpg&#39;, -48, 0], rightnav: [&#39;http://1.bp.blogspot.com/_v5IxGTiMTD8/SxOlAVn-OvI/AAAAAAAAAfo/kMJcmlXZKCs/s400/right.jpg&#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;]

})

</script>
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='http://www.bloggertemp.com/2010/01/blogger-template-made-in-spain.html' target='blank' title='Made in Spain'> <img alt='Made in Spain' height='135' src='http://2.bp.blogspot.com/_0SKrDjfr5oU/Sz4Y7UbEaOI/AAAAAAAAAFk/jQ0KY7f5LYY/s400/madeinspain.jpg' width='185'/> </a>
</div>
<!--end code of 1st Template -->
<!-- 2nd Template -->

<div class='panel'>
<a href='http://www.bloggertemp.com/2010/01/blogger-template-fashion-press.html' target='blank' title='Fashion Press'> <img alt='Fashion Press' height='135' src='http://2.bp.blogspot.com/_0SKrDjfr5oU/S0eQinj2JZI/AAAAAAAAAGk/IUxdzuDqjLU/s400/fashion-press.jpg' width='185'/> </a>

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

<!-- 3rd Template -->

<div class='panel'>
<a href='http://www.bloggertemp.com/2010/01/blogger-template-techlure.html' target='blank' title='Techlure'> <img alt='Techlure' height='135' src='http://4.bp.blogspot.com/_0SKrDjfr5oU/S1N4szb78_I/AAAAAAAAAMQ/qiD54DsKF3g/s640/techlure.JPG' title='Techlure' width='185'/> </a>
</div>
<!--end code of 3rd Template -->
<!-- 4th Template -->

<div class='panel'>
<a href='http://www.bloggertemp.com/2010/02/blogger-template-woodmag.html' target='blank' title='Woodmag'> <img alt='Woodmag' height='135' src='http://1.bp.blogspot.com/_0SKrDjfr5oU/S3bBpyMVuzI/AAAAAAAAANg/tpLnSSEgW2w/s640/Woodmag-blogger-template.jpg' title='Techlure' width='185'/> </a>
</div>
<!--end code of 4th Template -->
<!-- 5th Template -->

<div class='panel'>
<a href='http://www.bloggertemp.com/2010/02/blogger-template-showcase.html' target='blank' title='Showcase'> <img alt='Showcase' height='135' src='http://2.bp.blogspot.com/_0SKrDjfr5oU/S4gEU5L0qwI/AAAAAAAAAOM/qfEUlNYY3nI/s640/showcase-portfolio-blogger-template.JPG' title='Showcase' width='185'/> </a>
</div>
<!--end code of 5th Template -->
<!-- 6th Template -->

<div class='panel'>
<a href='http://www.bloggertemp.com/2010/03/blogger-template-versatile.html' target='blank' title='Versatile'> <img alt='Versatile' height='135' src='http://3.bp.blogspot.com/_0SKrDjfr5oU/S5DXiv8-jPI/AAAAAAAAAZ4/0_MjESQTaXM/s640/Versatile.JPG' title='Versatile' width='185'/> </a>
</div>
<!--end code of 6th Template -->

</div></div></div>
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.

5 comments:

Post a Comment

Followers

There was an error in this gadget
Blogumulus by Roy Tanck and Amanda Fazani
Free Blogger Tips, Hacks, Widgets, Templates and more