Monday, 22 August 2011
Newbie Featured content slider for blogger blog
Do you like this story?
Follow simple and easy step to adding this slider to your blog ---->>>>
* First go to your blogger Dashboard.
* Now click in design tab and edit HTML.
* Click in small box to expand your blogger Template.
* Now find this code </head> by CTRL+F key easily.
* Copy below code and paste before </head>
<script type='text/javascript'> //<![CDATA[ /* ------------------------------------------------------------------------ s3Slider -------------------------------------------------------------------------- */ (function($){ $.fn.s3Slider = function(vars) { var element = this; var timeOut = (vars.timeOut != undefined) ? vars.timeOut : 4000; var current = null; var timeOutFn = null; var faderStat = true; var mOver = false; var items = $("#" + element[0].id + "Content ." + element[0].id + "Image"); var itemsSpan = $("#" + element[0].id + "Content ." + element[0].id + "Image span"); items.each(function(i) { $(items[i]).mouseover(function() { mOver = true; }); $(items[i]).mouseout(function() { mOver = false; fadeElement(true); }); }); var fadeElement = function(isMouseOut) { var thisTimeOut = (isMouseOut) ? (timeOut/2) : timeOut; thisTimeOut = (faderStat) ? 10 : thisTimeOut; if(items.length > 0) { timeOutFn = setTimeout(makeSlider, thisTimeOut); } else { console.log("Poof.."); } } var makeSlider = function() { current = (current != null) ? current : items[(items.length-1)]; var currNo = jQuery.inArray(current, items) + 1 currNo = (currNo == items.length) ? 0 : (currNo - 1); var newMargin = $(element).width() * currNo; if(faderStat == true) { if(!mOver) { $(items[currNo]).fadeIn((timeOut/6), function() { if($(itemsSpan[currNo]).css('bottom') == 0) { $(itemsSpan[currNo]).slideUp((timeOut/20), function() { faderStat = false; current = items[currNo]; if(!mOver) { fadeElement(false); } }); } else { $(itemsSpan[currNo]).slideDown((timeOut/20), function() { faderStat = false; current = items[currNo]; if(!mOver) { fadeElement(false); } }); } }); } } else { if(!mOver) { if($(itemsSpan[currNo]).css('bottom') == 0) { $(itemsSpan[currNo]).slideDown((timeOut/20), function() { $(items[currNo]).fadeOut((timeOut/20), function() { faderStat = true; current = items[(currNo+1)]; if(!mOver) { fadeElement(false); } }); }); } else { $(itemsSpan[currNo]).slideUp((timeOut/20), function() { $(items[currNo]).fadeOut((timeOut/20), function() { faderStat = true; current = items[(currNo+1)]; if(!mOver) { fadeElement(false); } }); }); } } } } makeSlider(); }; })(jQuery); //]]> </script> <script type='text/javascript'> $(document).ready(function() { $('#s3slider').s3Slider({ timeOut: 4000 }); }); </script> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script> <style type='text/css'> /* Styles for the slideshow */ .crosscol { background: #000; width: 540px; height: 280px; padding: 0; margin-top: 16px; margin-bottom: 40px; } #s3slider { width: 580px; /* important to be same as image width */ height: 280px; /* important to be same as image height */ position: relative; /* important */ overflow: hidden; /* important */ left: 0px; } #s3sliderContent { width: 540px; /* important to be same as image width or wider */ position: absolute; /* important */ margin-left: 0; /* important */ } @media screen and (-webkit-min-device-pixel-ratio:0) { #s3sliderContent { } } .s3sliderImage { float: left; /* important */ position: relative; /* important */ display: none; /* important */ list-style: none; } .s3sliderImage span { position: absolute; /* important */ left: 0; font: 12px Arial, Helvetica, sans-serif; padding: 10px 20px 15px 20px; width: 500px; background-color: #000; filter: alpha(opacity=70); /* here you can set the opacity of box with text */ -moz-opacity: 0.7; /* here you can set the opacity of box with text */ -khtml-opacity: 0.7; /* here you can set the opacity of box with text */ opacity: 0.7; /* here you can set the opacity of box with text */ color: #fff; display: none; /* important */ bottom: 0; /* if you put top: 0; -> the box with text will be shown at the top of the image if you put bottom: 0; -> the box with text will be shown at the bottom of the image */ } .s3sliderImage strong a{ color: #FFF; font-family: 'Helvetica', arial, sans-serif; font-size:14px; text-transform: uppercase; font-weight: bold; } .s3sliderImage strong a:hover{ text-decoration: none; } .clear { clear: both; } </style>
* Now click to save your blogger Template.
* Again go to your blogger Dashboard and click in Design tab.
* Now you are here --->>> Page element.
* Click in Add Gadget which is in your blog sidebar.
* When open new window click in HTML/javascript from list.
* When open new blank box copy below code and paste in blank box.
<div class='crosscol'> <div id='s3slider'> <ul id='s3sliderContent'> <li class='s3sliderImage'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRDtih1c0HkED71SU3z5n5ocZ06zKwhrkiF46BnImMr-j88E4z9uEIJaVatARX5Ghb4aGCq2RG41Qcrm0HK0TJ5vyElmUFeThhJw__DmWBaEEekCnq4dA2fyvH10qm6cvC97FxapantPM/s1600/1.jpg'/> <span><strong><a href='ADD HERE POST1 URL'>ADD HERE POST1 TITLE</a></strong> <p>ADD HERE POST1 SHORT DESCRIPTION.</p> </span> </li> <li class='s3sliderImage'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8sgeebRlYb2UjuNhn0e9GZOG7UNxbt8SuqAMqdaYp2LtD0K4TLTliHhyphenhyphennxUbjaJrWv3tQrZW1eOzUQ7niPGbhEeItt684GlRXXIE1OZu0_6sPdtiZaGvNpOU0AaQZP14VHTFDNoH6W6Q/s1600/2.jpg'/> <span><strong><a href='ADD HERE POST2 URL'>ADD HERE POST2 TITLE</a></strong> <p>ADD HERE POST2 SHORT DESCRIPTION.</p> </span> </li> <li class='s3sliderImage'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCPUd2bR4Gk2xJGDURQT2zrGjibTGdlSSk5lfamKSsdrn05vdhJwGlfV-eANddBbgdsIPXxhOFQchmNRpJpH0IpJ_EYx1m1m6ar12o1gn9bX6vEyLGNNwDoUMG6xgoGq1QFTq4Np4WAn8/s1600/3.jpg'/> <span><strong><a href='ADD HERE POST3 URL'>ADD HERE POST3 TITLE</a></strong> <p>ADD HERE POST3 SHORT DESCRIPTION.</p> </span> </li> <li class='s3sliderImage'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpBjdiLH-e40bdceI_fIQ4a07sVecZXhr3asuyL3gJP-fI5BGm6DERkKjyuqo7whv-ZzLQX0rBqR7Ru_PQiUE_n8fyGxKJKJsDEg401-jroyfR8s7x6rGttud2Me6CSvpvGhmQarux26k/s1600/4.jpg'/> <span><strong><a href='ADD HERE POST4 URL'>ADD HERE POST4 TITLE</a></strong> <p>ADD HERE POST4 SHORT DESCRIPTION.</p> </span> </li> <li class='s3sliderImage'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhYgLJPc67c7jYx5obypCodYRXsuf7G3_j380twmDA69Ch4OeT4x98MI94WMZmTmJSikilLPNEGavc2MuYkpdd82qgFGdagY0nVdnmJOqcVCYxolECMDmKaxZbSyu8oAcD-5vmoGvM8-s/s1600/5.jpg'/> <span><strong><a href='ADD HERE POST5 URL'>ADD HERE POST5 TITLE</a></strong> <p>ADD HERE POST5 SHORT DESCRIPTION.</p> </span> </li> <div class='clear s3sliderImage'></div> </ul> </div>
NOTE:- Now remove Highlighted text from above code with your own ok.
* Now click to save your HTML/javascript and after saving this element Drag and drop this element below Blog Header.and again click to save button.
This post was written by: kashif
For Suggestions and complains email us at pakcompany@yahoo.comTwitter
Subscribe to:
Post Comments (Atom)
1 Responses to “Newbie Featured content slider for blogger blog”
17 December 2012 at 04:53
Hello, I put this code but I keep getting it like a black box, even if a put some image in it.
Post a Comment