A Simple Stylish jQuery Featured Slideshow For Blogger
Earlier this week i brought you a very cool jQueryFeatured Image Slider that can slide images and videos.In that post i
explained how i hadn't covered featured sliders or slideshows too much
but was gonna make up for it.So here we have another featured slider slash
slideshow slash image carousel.The slideshow in this post has a simple style
but that gives us some extra options, the main one is you can easily make it
any size to suit your blog or the images you want to use.
Step 1. In your Blogger dashboard click Design > Edit Html
Step 3. Copy and Paste the following code Directly Above / Before ]]></b:skin>
position: relative;
}
.image_reel {
position: absolute;
top: 0; left: 0;
}
.image_reel img {float: left;}
/*--Paging Styles--*/
.paging {
position: absolute;
bottom: 40px; right: -7px;
width: 178px; height:47px;
z-index: 100; /*--Assures the paging stays on the top layer--*/
text-align: center;
line-height: 40px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLV91XeF6Zi4JVjtAh3NKaR_hfirfOttTKRdz_Z0_N1_ka9hewdtluXFlZYyt8q5vabLbSke9-VpJgaF4eiEKWjv1LgDGbEEyCWXSLEI2vfPIJ_91UX-AW7bhcTSjn9RXKYnqzg5ukbemd/s1600/paging_bg2.png) no-repeat;
display: none; /*--Hidden by default, will be later shown with jQuery--*/
}
.paging a {
padding: 5px;
text-decoration: none;
color: #fff;
}
.paging a.active {
font-weight: bold;
background: #920000;
border: 1px solid #610000;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
}
.paging a:hover {font-weight: bold;}
Step 5. Copy and Paste the following code Directly Above / Before </head>
Step 6. Save your template.
That's the Script and Css added to your template to make the slider work now we add the html.
Step 1. OK back to your blogs design page and click Add A Gadget > Choose Html/Javascript :
</div>
</div>
</div>
</div>
Once you have your images and links added save the gadget and drag and drop it into position.
That's your simple jQuery slider added to Blogger.
If you face any problem in this post please let me know your problem. To inform your problem you can leave a comment below. And if you like my post please click the Facebook like button or spread this post by clicking the Twitter, Facebook etc. icons below and clicked any ad (plz). Because, it will be a great support for me.
Add The Simple Stylish Featured Slideshow To Blogger
Step 1. In your Blogger dashboard click Design > Edit Html
Step 2. Find the
following piece of code in your blogs Html : (Click Ctrl and F for a search bar
to help find the code)
]]></b:skin>
Step 3. Copy and Paste the following code Directly Above / Before ]]></b:skin>
/*--Main Container--*/
.main_view {
float: left;
position: relative;
}
/*--Window/Masking Styles--*/
.window {
.main_view {
float: left;
position: relative;
}
/*--Window/Masking Styles--*/
.window {
height:250px; width: 500px;
overflow: hidden;
/*--Hides anything outside of the set width/height--*/position: relative;
}
.image_reel {
position: absolute;
top: 0; left: 0;
}
.image_reel img {float: left;}
/*--Paging Styles--*/
.paging {
position: absolute;
bottom: 40px; right: -7px;
width: 178px; height:47px;
z-index: 100; /*--Assures the paging stays on the top layer--*/
text-align: center;
line-height: 40px;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLV91XeF6Zi4JVjtAh3NKaR_hfirfOttTKRdz_Z0_N1_ka9hewdtluXFlZYyt8q5vabLbSke9-VpJgaF4eiEKWjv1LgDGbEEyCWXSLEI2vfPIJ_91UX-AW7bhcTSjn9RXKYnqzg5ukbemd/s1600/paging_bg2.png) no-repeat;
display: none; /*--Hidden by default, will be later shown with jQuery--*/
}
.paging a {
padding: 5px;
text-decoration: none;
color: #fff;
}
.paging a.active {
font-weight: bold;
background: #920000;
border: 1px solid #610000;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
}
.paging a:hover {font-weight: bold;}
Change the size - I
currently have the size set to 500x250 as highlighted in the code above.You can
change this to make it bigger and remember that size is also the size of the
images you add.
Step 4. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code)
Step 4. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code)
</head>
Step 5. Copy and Paste the following code Directly Above / Before </head>
<script
src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'
type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function() {
//Set Default State of each portfolio piece
$(".paging").show();
$(".paging a:first").addClass("active");
//Get size of images, how many there are, then determin the size of the image reel.
var imageWidth = $(".window").width();
var imageSum = $(".image_reel img").size();
var imageReelWidth = imageWidth * imageSum;
//Adjust the image reel to its new size
$(".image_reel").css({'width' : imageReelWidth});
//Paging + Slider Function
rotate = function(){
var triggerID = $active.attr("rel") - 1; //Get number of times to slide
var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
$(".paging a").removeClass('active'); //Remove all active class
$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
//Slider Animation
$(".image_reel").animate({
left: -image_reelPosition
}, 500 );
};
//Rotation + Timing Event
rotateSwitch = function(){
play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
$active = $('.paging a.active').next();
if ( $active.length === 0) { //If paging reaches the end...
$active = $('.paging a:first'); //go back to first
}
rotate(); //Trigger the paging and slider function
}, 7000); //Timer speed in milliseconds (3 seconds)
};
rotateSwitch(); //Run function on launch
//On Hover
$(".image_reel a").hover(function() {
clearInterval(play); //Stop the rotation
}, function() {
rotateSwitch(); //Resume rotation
});
//On Click
$(".paging a").click(function() {
$active = $(this); //Activate the clicked paging
//Reset Timer
clearInterval(play); //Stop the rotation
rotate(); //Trigger rotation immediately
rotateSwitch(); // Resume rotation
return false; //Prevent browser jump to link anchor
});
});
</script>
<script type='text/javascript'>
$(document).ready(function() {
//Set Default State of each portfolio piece
$(".paging").show();
$(".paging a:first").addClass("active");
//Get size of images, how many there are, then determin the size of the image reel.
var imageWidth = $(".window").width();
var imageSum = $(".image_reel img").size();
var imageReelWidth = imageWidth * imageSum;
//Adjust the image reel to its new size
$(".image_reel").css({'width' : imageReelWidth});
//Paging + Slider Function
rotate = function(){
var triggerID = $active.attr("rel") - 1; //Get number of times to slide
var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
$(".paging a").removeClass('active'); //Remove all active class
$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
//Slider Animation
$(".image_reel").animate({
left: -image_reelPosition
}, 500 );
};
//Rotation + Timing Event
rotateSwitch = function(){
play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
$active = $('.paging a.active').next();
if ( $active.length === 0) { //If paging reaches the end...
$active = $('.paging a:first'); //go back to first
}
rotate(); //Trigger the paging and slider function
}, 7000); //Timer speed in milliseconds (3 seconds)
};
rotateSwitch(); //Run function on launch
//On Hover
$(".image_reel a").hover(function() {
clearInterval(play); //Stop the rotation
}, function() {
rotateSwitch(); //Resume rotation
});
//On Click
$(".paging a").click(function() {
$active = $(this); //Activate the clicked paging
//Reset Timer
clearInterval(play); //Stop the rotation
rotate(); //Trigger rotation immediately
rotateSwitch(); // Resume rotation
return false; //Prevent browser jump to link anchor
});
});
</script>
Step 6. Save your template.
That's the Script and Css added to your template to make the slider work now we add the html.
Step 1. OK back to your blogs design page and click Add A Gadget > Choose Html/Javascript :
Step 2. Copy and Paste
the following code into the Html/Javascript gadget ;
<div class="container">
<div class="folio_block">
<div class="main_view">
<div class="window">
<div class="image_reel">
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOycZMs5OaH0rsgc2jUCjm9Zv5ineB28NEuQG1FOsigWhzPaE4Kep84koeZ0Hk68u1wfI90YhaS0iXdUdC5dePWAlTb85oYWLVS_8lSgakNuhB-UgaMPdv_xxt6iCQk9H8K5SullGuOUF3/s1600/slider-image-1.jpg" alt="" /></a>
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGBeF8w5uDVZtUoJoZ6L-5Jm5oaKTLrJLRNY9e-MxRl5Xjmm7DPdTfNi-B7mk5zCObu7UC9hChrNdYZfwGd9TuEp-rFktlrhXUPSGn8XglktjQkd7geNQumk2z5fyhOI3Pbf-eGFt3IHwC/s1600/slider-image-2.jpg" alt="" /></a>
<a href="http://www.afoot-bd.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSTRuUxVc2gPBKcEHjRTKB1EV40Xr-0VUobgD3E1ikW-6Wvigh9nTCD43f4-QGgKyhHiXxSC9Ixsy6G9wO-qzrSiin-rBxiie28MK4m87R5-USLyAmOIRlvHoYX0NsUbqMeXWlExc5kbJU/s1600/slider-image-3.jpg" alt="" /></a>
<a href="http://www.banglasmsworld.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7ou8A0-WsBEDiUl-On3ZGKtixKzZDAaD2hkwoUch7yX9aQjKfx067houSjkBPhxdVpjljNIrFHITZEl4jxeZtf9pGGQtuKSnVdzA3GugdBwT5eISpm0A7gfk1JYaI5h1OFgSos_UiDod/s1600/slider-image-4.jpg" alt="" /></a>
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHpT6z2rNERlH3EghImBJENLesh136lr8XbjiynJM6NElcqnaLg5f5UQ-nsXSkV119X2y2tHhPZU0Kbf0m4UOXKptkbpijmnfXe4oQKpk4J6xL0IRh-vco9sNP5wqgIS7QJz3LG_sYKKe/s1600/slider-image-6.jpg" alt="" /></a>
</div>
</div>
<div class="paging">
<div class="folio_block">
<div class="main_view">
<div class="window">
<div class="image_reel">
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOycZMs5OaH0rsgc2jUCjm9Zv5ineB28NEuQG1FOsigWhzPaE4Kep84koeZ0Hk68u1wfI90YhaS0iXdUdC5dePWAlTb85oYWLVS_8lSgakNuhB-UgaMPdv_xxt6iCQk9H8K5SullGuOUF3/s1600/slider-image-1.jpg" alt="" /></a>
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGBeF8w5uDVZtUoJoZ6L-5Jm5oaKTLrJLRNY9e-MxRl5Xjmm7DPdTfNi-B7mk5zCObu7UC9hChrNdYZfwGd9TuEp-rFktlrhXUPSGn8XglktjQkd7geNQumk2z5fyhOI3Pbf-eGFt3IHwC/s1600/slider-image-2.jpg" alt="" /></a>
<a href="http://www.afoot-bd.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSTRuUxVc2gPBKcEHjRTKB1EV40Xr-0VUobgD3E1ikW-6Wvigh9nTCD43f4-QGgKyhHiXxSC9Ixsy6G9wO-qzrSiin-rBxiie28MK4m87R5-USLyAmOIRlvHoYX0NsUbqMeXWlExc5kbJU/s1600/slider-image-3.jpg" alt="" /></a>
<a href="http://www.banglasmsworld.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7ou8A0-WsBEDiUl-On3ZGKtixKzZDAaD2hkwoUch7yX9aQjKfx067houSjkBPhxdVpjljNIrFHITZEl4jxeZtf9pGGQtuKSnVdzA3GugdBwT5eISpm0A7gfk1JYaI5h1OFgSos_UiDod/s1600/slider-image-4.jpg" alt="" /></a>
<a href="http://www.music2radio.blogspot.com/"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHpT6z2rNERlH3EghImBJENLesh136lr8XbjiynJM6NElcqnaLg5f5UQ-nsXSkV119X2y2tHhPZU0Kbf0m4UOXKptkbpijmnfXe4oQKpk4J6xL0IRh-vco9sNP5wqgIS7QJz3LG_sYKKe/s1600/slider-image-6.jpg" alt="" /></a>
</div>
</div>
<div class="paging">
<a href="#"
rel="1">1</a>
<a href="#" rel="2">2</a>
<a href="#"
rel="3">3</a>
<a href="#"
rel="4">4</a>
<a href="#"
rel="5">5</a>
</div>
</div>
</div>
</div>
Adding Your Slides
Highlighted in red are the URLs this is were the image will lead to when clicked.
Highlighted in green is the Image URLs replace these with the URLs of your images.
To add more than 5 slides simply add another link and image the same as the ones there now.But make sure to add another number to the pager highlighted in blue.So at the moment there are 5 slides and the pager in blue goes to 5.If you added a 6th slide you would add it like this :
Highlighted in red are the URLs this is were the image will lead to when clicked.
Highlighted in green is the Image URLs replace these with the URLs of your images.
To add more than 5 slides simply add another link and image the same as the ones there now.But make sure to add another number to the pager highlighted in blue.So at the moment there are 5 slides and the pager in blue goes to 5.If you added a 6th slide you would add it like this :
<a href="#" rel="6">6</a>
Once you have your images and links added save the gadget and drag and drop it into position.
That's your simple jQuery slider added to Blogger.
If you face any problem in this post please let me know your problem. To inform your problem you can leave a comment below. And if you like my post please click the Facebook like button or spread this post by clicking the Twitter, Facebook etc. icons below and clicked any ad (plz). Because, it will be a great support for me.
Nice tutorial....
ReplyDelete