10 November 2009 0 Comments

s3Slider jQuery Plugin & Tutorial

The s3Slider jQuery plugin is made by example of jd`s smooth slide show script.

Usage:

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/s3Slider.js" type="text/javascript"></script>

HTML:

<div id="s3slider">
   <ul id="s3sliderContent">
      <li class="s3sliderImage">
          <img src="#" />
          <span>Your text comes here</span>
      </li>
      <li class="s3sliderImage">
          <img src="#" />
          <span>Your text comes here</span>
      </li>
      <div class="clear s3sliderImage"></div>
   </ul>
</div>

Sample CSS:

#s3slider {
   width: 400px; /* important to be same as image width */
   height: 300px; /* important to be same as image height */
   position: relative; /* important */
   overflow: hidden; /* important */
}

#s3sliderContent {
   width: 400px; /* important to be same as image width or wider */
   position: absolute; /* important */
   top: 0; /* important */
   margin-left: 0; /* important */
}

.s3sliderImage {
   float: left; /* important */
   position: relative; /* important */
   display: none; /* important */
}

.s3sliderImage span {
   position: absolute; /* important */
   left: 0;
   font: 10px/15px Arial, Helvetica, sans-serif;
   padding: 10px 13px;
   width: 374px;
   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 */
   top: 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
   */
}

.clear {
   clear: both;
}

Inside in HTML:

$(document).ready(function() {
   $('#s3slider').s3Slider({
      timeOut: 4000
   });
});

timeOut: values in miliseconds…

ExampleWebsite

Download

Full version (with examples) (size: 574kb)
Uncompressed version (size: 4.12kb)
Compressed version (size: 1.66kb)

http://jqueryblog.net/wp-content/plugins/sociofluid/images/digg_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/reddit_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/dzone_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/delicious_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/blinklist_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/blogmarks_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/furl_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/newsvine_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/technorati_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/magnolia_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/google_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/myspace_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/facebook_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/yahoobuzz_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/sphinn_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/mixx_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/twitter_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/jamespot_24.png http://jqueryblog.net/wp-content/plugins/sociofluid/images/meneame_24.png

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes