This time I will share jQuery Plugin and tutorial about Minimal Clean Banner Slideshow Plugin – jQuery jsslider, hope it will help you in programming stack.
jsslider is a simple, configurable jQuery carousel plugin for generating a banner slideshow from plain html elements.
By default, the banner slide automatically fades through a set of slides at a given interval. You users are also able to switch between the slides by hover/click/tap the pagination bullets.
How to use it:
1. Build the HTML structure for the banner slideshow.
01 |
< div id = "banner_wrap" > |
02 |
< div class = "banner_content" > |
03 |
< a id = "banner0" class = "banner" ></ a > |
04 |
< a id = "banner1" class = "banner" href = "javascript:;" ></ a > |
05 |
< a id = "banner2" class = "banner" href = "javascript:;" ></ a > |
06 |
< a id = "banner3" class = "banner" href = "javascript:;" ></ a > |
07 |
< a id = "banner4" class = "banner" href = "javascript:;" ></ a > |
10 |
< div class = "banner_nav" > |
12 |
< li class = "navLi" ></ li > |
13 |
< li class = "navLi" ></ li > |
14 |
< li class = "navLi" ></ li > |
15 |
< li class = "navLi" ></ li > |
16 |
< li class = "navLi" ></ li > |
2. The necessary CSS styles for the banner slideshow.
22 |
background : no-repeat center center |
3. Customize the styles of the pagination bullets.
09 |
display : inline- block ; |
15 |
background : rgba( 224 , 224 , 224 , 0.8 ); |
18 |
.banner_nav ul li.curr { background : rgba( 255 , 255 , 255 , 1 ); } |
4. Add your own background images to the carousel slides.
01 |
#banner 0 { background-image : url ( 1 .png) } |
03 |
#banner 1 { background-image : url ( 2 .png) } |
05 |
#banner 2 { background-image : url ( 3 .png) } |
07 |
#banner 3 { background-image : url ( 4 .png) } |
09 |
#banner 4 { background-image : url ( 5 .png) } |
5. Put the jQuery jsslider plugin’s JavaScript after loading jQuery.
2 |
integrity = "sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" |
3 |
crossorigin = "anonymous" ></ script > |
4 |
< script src = "jsslider.js" ></ script > |
6. The JavaScript to render a banner slideshow on the page.
1 |
$( '#banner_wrap' ).slider({ |
2 |
'banItemClass' : 'banner' , |
3 |
'navItemClass' : 'navLi' , |
4 |
'navWrapClass' : 'banner_nav' , |
7. All default plugin options.
01 |
$( '#banner_wrap'
source : jquery.net
|