Sunday, 12 August 2012

Newbie Featured content slider for blogger blog / Style 4!



Newbie Featured content slider for blogger blog








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/AVvXsEjubPn_iairlfvrVfdjEtMTT3zoFiH35pBZDzCfuV5lWnc_eBcGYLrOQ9WR_5xNF2tcQXqblGpxa6g17lCJraMX1x82IaUOalabFcqove28px6Rk8kPcRA0ZAWkvcdw8bviqdFcb8fRTkU/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/AVvXsEg6uycEIf3-dXtYHdCjpQEx5liEOo-X20EhiNRXmWHQJen_ZeIafft4f852khe4Nk3q2xdtIQeUIrUckdNlVuAbFegkZAuZd2F1H9jyJwKSuGFo6U_MdJe0-rQVJuLA4a9Ow3pGbTepMlo/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/AVvXsEj7rnKIzlkhCmIBjdfLyXB56Ye5rnBbA3Qj2TXPt6YUxsg0qBR9K8ZaYUgRpqbR8HgJL9nkWB4jvJ6Z5EmlxjwF8vjD1sE8DXUJ9pF7DSpC5ZHFOBPHwvmI7yRJIbrtyU2trbgqHfpEqI4/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/AVvXsEgJXuWGldGOwrw131qh0Ltsvas1BrsWL6y5INydGAP7gn3DuRpNaWZ43U0C6R0cPrY-2Y1KGe1ugjUqtS1sF2oLpiIyqYbvKsTRXecL4VsbqtupGcGItKj2qdetPCHTR69YybERXHHeZko/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/AVvXsEiWXpTpbedwdDJ15b6BpSkluZ28wccKK9nJzR1H5_nCvH-ZNcw1Ha-rSomn4lmF15udoOfPOKlcdZGMRCQMPzwj8xwKCW3SSIETeI5HwbVtZIj6Mx6KZJK2nwRN_K2pjTaF1qpMRpkjrHM/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.

* Now you are done.

No comments: