I recommend you download a backup copy of your template or use a test blog I'm going to use a 3 column template from my previous tutorial but it should work with any template now we need to download two scripts named jquery.js and s3Slider.js you can read more and download the scripts from this link or just grab the embedded source code from the demo.
Once you have the two scripts you can either upload them to your server or embed the scripts directly in the page i will show you both ways the first assuming that you have uploaded them to your server
go to layout > edit html and paste the following code just before the closing
</head> tag making sure you replace the red comment with the direct link to the scripts if you have them on your own server <script src='http://./jquery.js' type='text/javascript'/>
<script src='http://./s3Slider.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('#slider1').s3Slider({
timeOut: 5000
});
});
//]]>
</script>otherwise if you do not have the scripts on your own server paste the following code just before the closing
</head> tag <script type='text/javascript'>
//<![CDATA[
/* paste contents of your scripts here */
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$('#slider1').s3Slider({
timeOut: 5000
});
});
//]]>
</script>replacing the red comment with the full contents of the scripts you downloaded by opening them with a simple text editor the code in green is to set the duration of how long will one picture be shown on the page in milliseconds.
Once you have the scripts installed add the following CSS code adjusting the parts highlighted in red to the exact width and height of your images
#slider1 {
width:525px; /* To be same as image width */
height:237px; /* To be same as image height */
position: relative;
overflow: hidden;
border:1px solid #eee;
margin:0 auto;
}
#slider1Content {
width:525px; /* To be same as image width or wider */
position: absolute;
top: 0;
list-style:none;
margin:0;
padding:0;
}
.slider1Image {
float: left;
position: relative;
display: none;
}
.slider1Image span {
position: absolute;
font: 10px/15px Arial, Helvetica, sans-serif;
padding: 10px 13px;
width:550px;
background-color: #000;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
color: #fff;
display: none;
bottom:0;
}
.clear {
clear: both;
}
.slider1Image span strong {
font-size:14px;
}Now save your template then go to the page element tab and add a html/javascript widget just above the post and leave the title field empty with the following xhtml code in
<div id="slider1">
<ul id="slider1Content">
<li class="slider1Image">
<a href='http://myblogpost.html'>
<img alt="my image" src="http://tinypic.com/5xpc1.jpg"/>
</a>
<span>
<strong>Some title</strong>
<br/>
some description text here
</span>
</li>
<li class="slider1Image">
<a href='http://someblogpost.html'>
<img alt="some image" src="http://tinypic.com/5fde1.jpg"/>
</a>
<span>
<strong>Some title</strong>
<br/>
some description text here
</span>
</li>
<div class="clear slider1Image"></div>
</ul>
</div>In the code above i have added two images if you would like more it's just a matter of copying one of the blocks of code in between the <li></li> tags so the first part highlighted in green is the link to your blog post while the code highlighted in red is the direct link to the image and the blue text is the title and description of your image so now you should have a working image slider you can also have the caption coming in from the top, left or right side of the images i recommend you read more about it on the authors site.
Thanks for reading comments are welcome see my result



19 Responses to “How to add a jquery image slider to your blogger powered blog”
Anonymous
July 08, 2009Thanks lawny I'm gonna try this on my blog
faiz
July 13, 2009wow..good article, your article very help..thanks
blinkky
July 24, 2009Good tips. I saw many bloggers did this.
julio
July 31, 2009Thank u very much lawny, i'm trying to make it work in your fabulous Corporate style 2 column blogger template in the place of the header.
it works fine in firefox, but in IE8 doesnt display some of the pictures. dont know whats the problem.
Lawny
August 01, 2009@julio
i have tested the demo on my vista machine using IE8 and it works fine maybe you have made a mistake somewhere in the code what is the url of the site ?
sabrin
September 08, 2009Wow...lawny...you are genius!! this is beautifull jquery slider!
heartlessgamer
October 25, 2009Good stuff. Is there anyway to have this auto populate with an image from new posts?
Lawny
October 26, 2009@heartlessgamer
I'm not aware of anyway it can be auto populated on blogger however it can easy be done on WordPress
heartlessgamer
December 03, 2009I'm testing this at http://test.heartlessgamer.com/ and am unable to get the images to display. Not sure what I am doing wrong.
Lawny
December 04, 2009@heartlessgamer
i noticed you are using one of my templates with my credit links removed which i do not allow so i recommend you return them if you plan on using my template as for the images not loading try hosting the images on photobucket or tinypic because i dont think blogger allows hotlinking to the full size image
heartlessgamer
December 04, 2009Its a copied over template from my main site to test (hence the test subdomain). If you notice, www.heartlessgamer.com has always had the credit links in place.
I've tried hosting the pictures via blogger directly and tried using pictures on Flickr without success.
Lawny
December 04, 2009@heartlessgamer
your images are still linked to blogger as i have viewed the source code so they will not work like i said you cannot hotlink to them to see what i mean try creating an html document on your desktop and linking to those images because they do not load for me as you can see the demo works fine for me the images are hosted on tinypic
heartlessgamer
December 04, 2009Thanks for the help so far. I have swapped it back to Flickr pictures, but still don't see them.
I hotlinked to both pictures in the test post to confirm they are working.
I removed the header and searchbar from the template. Would that affect this?
Also, the credits link is restored on the test page.
Lawny
December 04, 2009@heartlessgamer
i have just tested your images on one of my blogs and they work fine however the script in your template doesn't work like it should try copying the full script from the demo by right clicking the page and viewing the source code
tanto
December 14, 2009wow..your article its cool..thanks
RAHUL
December 18, 2009MAN WHAT A TALENT YOU HAVE GOT I APPERICEATED IT YOU ARE DOING A GREAT JOB.....
Paul Meara
February 21, 2010Nice slider but I can't get it to work, my site is www.paulmeara.com you can see it on the top of my blog posts...
Lawny
February 21, 2010@Paul
you have the jquery script included twice remove the following line from the bottom of your template and save that should fix it
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
Paul Meara
February 21, 2010Hey man thank you so much, looks great, really appreciate it!
Leave a Reply
Feel free to leave your comment however comments are moderated before appearing on site