[jQuery plugin.] iPhone slide plugin

其实是自己写好玩的东西,所以我也不知道大家会不会感兴趣 :P
Live Demo
GitHub

可以设定的方式大概是这样:

$('#album').iphoneSlide({// Page items handler, default: the first child of the $('album').handler: undefined,// Pages handler, default: the children of the handler.pageHandler : undefined,// Drag area handler, default: full page area.slideHandler : undefined,// You can define an element to handle this event(default: click) slide to next page.nextPageHandler : '.nextPage',// You can define an element to handle this event(default: click) slide to previous page.prevPageHandler : '.prevPage',// The friction of slide page.friction : 0.325,// When drag&drop page, the point length must be larger than this value which event will be fire.sensitivity : 20,// Slow down the page shift speed(ms).extrashift : 500,// If drag&drop over this time(ms), there will always slide 1 page.touchduring : 800,// Direction of slide, there are three directions you can choose(horizontal, vertical and matrix).direction : 'horizontal',// Max slide page.maxShiftPage : 5,// It's only for dynamic page(s).pageshowfilter : false,// Support jquery easing plugin, via http://gsgd.co.uk/sandbox/jquery/easing/    easing: "swing",    // Turn on/off default animate effect "bounce".    bounce: true,autoPlay: false,cancelAutoPlayOnResize: true,    autoCreatePager: false,pager: {pagerType: "dot",        selectorName: ".banner_pager",        childrenOnClass: "on",slideToAnimated: true},autoPlayTime: 3000,// When slide page completed, fire this.onShiftComplete : function(elem, page) {// this is parent of the handler.// elem is nowPage's page item.// page is "nowPage".}});

有趣的地方是,写这个 Plugin 让我学到很多,只是 JS 还是写得很不好就是了 XDD


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章