Changeset 21074


Ignore:
Timestamp:
2011/07/29 15:26:54 (9 years ago)
Author:
468
Message:

#1413 スマートフォン版FlickSliderの動作変更対応

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/html/user_data/packages/sphone/js/jquery.flickslide.js

    r21059 r21074  
    22// Copyright (c) 2011 Kosuke Araki - twitterF@kaleido_kosuke 
    33// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php 
    4 (function($){$.fn.flickSlide=function(settings){var strUA=navigator.userAgent.toLowerCase(),webkitUA=['iphone','android','ipad'],runiLayout=false,iLayoutLocation='',currentX=0,maxX=0,slideObj={},slideLock=1,slideTimer={},slideLotation={},slideDuration=4000,slideCount=0,pagerMax=0,orientationChangeDelay=0;for(var i=0;i<webkitUA.length;i++){if(strUA.indexOf(webkitUA[i],0)!=-1){runiLayout=true;if(webkitUA[i]==='android'){orientationChangeDelay=400} 
     4(function($){$.fn.flickSlide=function(settings){var currentX; var maxX;var strUA=navigator.userAgent.toLowerCase(),webkitUA=['iphone','android','ipad'],runiLayout=false,iLayoutLocation='',currentX=0,maxX=0,slideObj={},slideLock=1,slideTimer={},slideLotation={},slideDuration=4000,slideCount=0,pagerMax=0,orientationChangeDelay=0;for(var i=0;i<webkitUA.length;i++){if(strUA.indexOf(webkitUA[i],0)!=-1){runiLayout=true;if(webkitUA[i]==='android'){orientationChangeDelay=400} 
    55if(webkitUA[i]==='iphone'){orientationChangeDelay=0}}} 
    66//if(runiLayout!==true){return;} 
     
    1818slideTimer=setTimeout(lotation,slideDuration);slideLock=0;}} 
    1919slideTimer=setTimeout(lotation,slideDuration);} 
    20 var settings=$.extend({target:'',colum:1,height:170,duration:4000},settings);var contents=$(this);var contentsLength=contents.length;var wrap=$('<div class="flickSlideContainer"><div class="moveWrap"><ul class="move"></ul></div></div>');var slideMask=$('<div class="slideMask resizable"></div>');var bottom=$('<div class="flickSlideBottom"><div class="bottomLeft off">&lt;</div><ul class="slidePager"></ul><div class="bottomRight">&gt;</div></div>'); 
     20var settings=$.extend({target:'',colum:1,height:170,duration:4000,parentArea:''},settings);var contents=$(this);var contentsLength=contents.length;var wrap=$('<div class="flickSlideContainer"><div class="moveWrap"><ul class="move"></ul></div></div>');var slideMask=$('<div class="slideMask resizable"></div>');var bottom=$('<div class="flickSlideBottom"><div class="bottomLeft off">&lt;</div><ul class="slidePager"></ul><div class="bottomRight">&gt;</div></div>'); 
    2121//$(this).contents().find('img').removeAttr('width').removeAttr('height').css({width:'100%',height:'auto'}); 
    2222var loop=Math.floor(contentsLength/settings.colum);loop=contentsLength%settings.colum>0?loop++:loop;pagerMax=loop-1;var contentsCount=0;for(var i=0;i<loop;i++){var unitElem=$('<li/>').addClass('slideUnit').addClass('resizable');var pager=$('<li id="pager'+i+'" class="slidePagerPointer"></li>');if(i===0){pager.addClass('active')} 
     
    2424unitElem.append(itemElem);contentsCount++;} 
    2525wrap.contents().find('ul.move').append(unitElem);bottom.children('ul.slidePager').append(pager);} 
    26 $(settings.target).after(wrap);$(settings.target).remove();bottom.children('.bottomLeft').slideButton({direction:'prev',widthSource:wrap.contents().find('li.slideUnit')});bottom.children('.bottomRight').slideButton({direction:'next',widthSource:wrap.contents().find('li.slideUnit')});wrap.contents().find('ul.move').touchDrag({duration:settings.duration});wrap.after(bottom);$(window).bind('load',function(){var styles=getComputedStyle($('.moveWrap').get(0));if(styles){$('.resizable').css('width',styles.width);$('.slideMask').css('height',$('.move').outerHeight()).css('width',styles.width-1);maxX=Number($('.flickSlideContainer li.slideUnit').length-1)*Number(styles.width.replace('px',''))*-1;} 
     26//ƒXƒ‰ƒCƒhÅ‘啝‚ð•\Ž¦ƒGƒŠƒA‚̉¡•~li‚̐”¨li‚̉¡•~li‚̐”‚ɕύX 
     27$(settings.target).after(wrap);$(settings.target).remove();bottom.children('.bottomLeft').slideButton({direction:'prev',widthSource:wrap.contents().find('li.slideUnit')});bottom.children('.bottomRight').slideButton({direction:'next',widthSource:wrap.contents().find('li.slideUnit')});wrap.contents().find('ul.move').touchDrag({duration:settings.duration});wrap.after(bottom);$(window).bind('load',function(){var styles=getComputedStyle($('.moveWrap').get(0));if(styles){$('.resizable').css('width',styles.width);$('.slideMask').css('height',$('.move').outerHeight()).css('width',styles.width-1);maxX=Number($(settings.parentArea + ' .flickSlideContainer li.slideUnit').length-1)*Number(getComputedStyle($(settings.parentArea + ' .flickSlideContainer li.slideUnit').get(0)).width.replace('px',''))*-1;} 
    2728var slideFirstChild=$('ul.move li:first').clone();$('ul.move').show();});}})(jQuery);var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'} 
    2829is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;} 
Note: See TracChangeset for help on using the changeset viewer.