Here is croll which is a powerful, mobile touch-friendly javascript smooth scroller library for multiple purpose.If you want more Scroller then keep watching bloggingtrainings.blogspot.com. below is link for downloading and demo.
Here is Basic Usage (create an image carousel):
Load the iscroll.js in the html document.
1 | < script type = "text/javascript" src = "iscroll.js" ></ script > |
Create the html for an image carousel following the html structure like this:
01 | < body onload = "loaded()" > |
06 | < div class = "painting giotto" ></ div > |
09 | < div class = "painting leonardo" ></ div > |
12 | < div class = "painting gaugin" ></ div > |
15 | < div class = "painting warhol" ></ div > |
The CSS to style the image carousel.
17 | -webkit-tap-highlight- color : rgba( 0 , 0 , 0 , 0 ); |
20 | -webkit-transform: translateZ( 0 ); |
21 | -moz-transform: translateZ( 0 ); |
22 | -ms-transform: translateZ( 0 ); |
23 | -o-transform: translateZ( 0 ); |
24 | transform: translateZ( 0 ); |
25 | -webkit-touch-callout: none ; |
26 | -webkit-user-select: none ; |
27 | -moz-user-select: none ; |
30 | -webkit-text-size-adjust: none ; |
31 | -moz-text-size-adjust: none ; |
32 | -ms-text-size-adjust: none ; |
33 | -o-text-size-adjust: none ; |
34 | text-size-adjust: none ; |
35 | background-color : #444 ; |
47 | border : 1px solid #000 ; |
48 | box-shadow: inset 2px 2px 6px rgba( 255 , 255 , 255 , 0.6 ), inset -2px -2px 6px rgba( 0 , 0 , 0 , 0.6 ), 0 1px 8px rgba( 0 , 0 , 0 , 0.8 ); |
51 | background : url (giotto.jpg); |
54 | background : url (leonardo.jpg); |
57 | background : url (gaugin.jpg); |
60 | background : url (warhol.jpg); |
67 | background : url (data:image/png;base 64 ,iVBORw 0 KGgoAAAANSUhEUgAAAB 4 AAAAUBAMAAABohZD 3 AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB 3 RJTUUH 3 QUGCDYztyDUJgAAAB 1 pVFh 0 Q 29 tbWVudAAAAAAAQ 3 JlYXRlZCB 3 aXRoIEdJTVBkLmUHAAAAGFBMVEUAAADNzc 3 Nzc 3 Nzc 3 Nzc 3 Nzc 3 Nzc 3 /// 8 aWwwLAAAABnRSTlMAX 5 Ks 3 /nRD 0 HIAAAAAWJLR 0 QHFmGI 6 wAAAFtJREFUGFdjYGBgEHYNMWRAAJE 0 IHCEc 5 nSwEABxleD 8 JOgXMY 0 KBCA 8 FlgfAcIXwzGT 4 TwzWD 8 ZAjfDcZPgfDDYPxU 7 Hx 09 ejmoduH 7 h 5096 L 7 B 8 O/ 6 OGBGl 4 APYg 8 TQ 0 XAScAAAAASUVORK 5 CYII=); |
The javascript to initialize the image carousel.
01 | <script type= "text/javascript" > |
06 | myScroll = new IScroll( '#wrapper' , { |
14 | el: document.getElementById( 'indicator' ), |
20 | document.addEventListener( 'touchmove' , function (e) { e.preventDefault(); }, false ); |
Post a Comment
PLEASE DON'T PLACE BULK MESSAGE , FOR ADVERTISING!