1(function(window, $){ 2$(function(){ 3 var _bEffectNone=function(){}, 4 bEffectNone={}, 5 6 _bEffectFade=function(){}, 7 bEffectFade= { 8 wrapper: $("#coverWrap") 9 ,option: { 10 animation: false 11 ,design: ($("#coverList").length>0 ? $("#coverList").attr("class").replace("design","") : '00') 12 ,debug: false 13 ,duration: cover_duration 14 ,interval: cover_interval 15 ,length: $("#coverWrap img").length 16 ,viewWidth: $("#coverArea").width() 17 ,offset: $("#coverArea").outerWidth() 18 ,resize: false 19 ,defer: null 20 ,easing: "easeOutCubic" 21 } 22 ,position: 0 23 //åæåå¦ç 24 ,init: function(){ 25 //åçã«#coverWrapã«è¨å®ãããã®ã¯width,height,margin-leftã®ã¿ 26 if($("#coverList").length <= 0){ 27 return false; 28 } 29 30 if(1500 < this.option.viewWidth){ 31 this.option.viewWidth = $(window).width(); 32 } 33 if(1500 < this.option.offset){ 34 this.option.offset = $(window).width(); 35 } 36 37 //ç»åå¹ ã表示ã¨ãªã¢å¹ ã«è¨å® 38 this.wrapper.find("a,img").width(this.option.viewWidth); 39 //åä¸ç»å or è¤æ°æ¯ã§ã¯ã©ã¹ãåãããããã®è¡¨ç¤ºãåãæ¿ã 40 if(this.option.length < 2){ 41 this.wrapper.find(">a").addClass("cover-single").removeAttr("style"); 42 $("#coverList").find(".nav, #coverLeft, #coverRight").css({display: 'none'}); 43 }else{ 44 this.wrapper.find(">a").addClass("cover-multi").removeAttr("style"); 45 $("#coverList").find(".nav, #coverLeft, #coverRight").removeAttr("style"); 46 } 47 48 this.wrapper.width(this.option.viewWidth); 49 50 /* v1.6 */ 51 h = parseInt($("#coverWrap-height").attr("h")); 52 if ( h == 0) { 53 h = "auto"; 54 } else { 55 h = h + "px"; 56 } 57 this.wrapper.height(h); 58// this.wrapper.height("auto"); 59 /* v1.6 2014.07.04 */ 60 61 62 this.setImagePosition(); 63 64 //2æä»¥ä¸ã®æã¯ã¢ãã¡ã¼ã·ã§ã³éå§ 65 if(1 < this.option.length){ 66 this.playAuto(); 67 this.removeNaviEvent(this.option.design); 68 this.addNaviEvent(this.option.design); 69 } 70 71 $(document).trigger("bCoverReady"); 72 } 73 ,setImagePosition: function(){ 74 var _this = this; 75 this.wrapper.find(">a").css({"margin-left": "0"}); 76 this.wrapper.find(">a").not(":first").each(function(){ 77 $(this).css({"margin-left": "-100%"}); 78 }); 79 } 80 //ãã©ã¡ã¼ã¿ãªã»ãã 81 ,reset: function(){ 82 //this.wrapper = $("#coverWrap").removeAttr('style'); 83 this.wrapper = $("#coverWrap"); 84 this.option.animation = false; 85 this.option.design = ($("#coverList").length>0 ? $("#coverList").attr("class").replace("design","") : '00'); 86 this.option.duration = cover_duration; 87 this.option.interval = cover_interval; 88 this.option.length = $("#coverWrap img").length; 89 this.option.viewWidth = $("#coverArea").width(); 90 this.option.offset = $("#coverArea").outerWidth(); 91 this.init(); 92 $(window).off('resize', this.resizeHandler); 93 $(window).on('resize', {obj:this}, this.resizeHandler); 94 } 95 ,start: function(){ 96 this.init(); 97 $(window).off('resize', this.resizeHandler); 98 $(window).on('resize', {obj:this}, this.resizeHandler); 99 window.bEffects = this; 100 return this; 101 } 102 ,stop: function(){ 103 clearTimeout(coverAutoID); 104 coverAutoID = null; 105 this.wrapper.stop(true).css({"margin-left": 0}); 106 } 107 ,playAuto: function(){ 108 var _this = this; 109 if(coverAutoID!=null){ 110 this.stop(); 111 } 112 coverAutoID = setTimeout(function(){ 113 _this.debug("playAuto::setTimeout();"); 114 _this.showNext(); 115 }, this.option.interval); 116 } 117 ,showNext: function(){ 118 var _this = this; 119 if(!_this.option.animation){ 120 _this.option.animation = true; 121 _this.wrapper.find("a:last>img").animate({"opacity": 0}, {duration: _this.option.duration, easing: _this.option.easing, complete: function(){ 122 _this.position++; 123 if(_this.option.length <= _this.position){ 124 _this.position = 0; 125 } 126 _this.wrapper.find(">a:last").prependTo(_this.wrapper); 127 _this.wrapper.find(">a:first>img").css({"opacity": 1}); 128 _this.setNavigation(_this.position); 129 _this.option.animation = false;
130 _this.setImagePosition(); 131 _this.playAuto(); 132 133 _this.debug("showNext::complete();"); 134 135 _this.debug("CURRENT="+_this.position); 136 } 137 }); 138 } 139 } 140 ,showPrev: function(){ 141 var _this = this; 142 if(!_this.option.animation){ 143 _this.option.animation = true; 144 //éæã«ãã 145 _this.wrapper.find(">a:first>img").css({opacity: 0}); 146 //åé¢ã«é ç½® 147 _this.wrapper.find(">a:first").appendTo(_this.wrapper); 148 //ä½ç½®ã»ãã 149 _this.setImagePosition(); 150 //ã¨ãã§ã¯ãéå§ 151 _this.wrapper.find(">a:last>img").animate({"opacity": 1}, {duration: _this.option.duration, easing: _this.option.easing, complete: function(){ 152 _this.position--; 153 if(_this.position < 0){ 154 _this.position = (_this.option.length-1); 155 } 156 _this.setNavigation(_this.position); 157 _this.option.animation = false; 158 _this.playAuto(); 159 _this.debug("CURRENT="+_this.position); 160 } 161 }); 162 } 163 } 164 ,slideToPage: function(t){ 165 var _this = this; 166 if(!_this.option.animation){ 167 clearTimeout(coverAutoID); 168 //ç§»åã¹ã©ã¤ãæ° 169 var offset = t - this.position; 170 //1ãã¼ã¸ç§»åã®æ 171 if(Math.abs(offset) == 1){ 172 if(offset == 1){ 173 _this.showNext(); 174 }else{ 175 _this.showPrev(); 176 } 177 } 178 //2ãã¼ã¸ä»¥ä¸ã®æ 179 else if(1 < Math.abs(offset) ){ 180 _this.multiSlide(offset); 181 } 182 } 183 } 184 ,setPosition: function(p){ 185 this.position = p; 186 if(this.option.length <= this.position){ 187 this.position = 0; 188 } 189 else if(this.position < 0){ 190 this.position = (this.option.length-1); 191 } 192 } 193 ,multiSlide: function(offset){ 194 var _this = this; 195 if(!_this.option.animation){ 196 _this.option.animation = true; 197 var len = Math.abs(offset); 198 199 if(0 < offset){ 200 var target_position = (_this.option.length-1)-offset; 201 202 //䏿¦è¡¨ç¤ºä¸ä»¥å¤å ¨ã¦é表示 203 _this.wrapper.find(">a").not(":last").find(">img").css({opacity:0}); 204 //ç®æ¨ä½ç½®ã®ç»åã ã表示 205 _this.wrapper.find(">a:eq("+target_position+")>img").css({opacity:1}); 206 //ã¨ãã§ã¯ãéå§ 207 _this.wrapper.find("a:last>img").animate({"opacity": 0}, {duration: _this.option.duration, easing: _this.option.easing, complete: function(){ 208 //é åºå ¥ãæ¿ã 209 for(var i = 0; i < len; i++){ 210 _this.wrapper.find(">a:last").prependTo(_this.wrapper); 211 _this.position++; 212 } 213 214 //å ¨ã¦è¡¨ç¤º 215 _this.wrapper.find(">a").not(":last").find(">img").css({opacity:1}); 216 217 //ä½ç½®ã»ãã 218 _this.setImagePosition(); 219 220 if(_this.option.length <= _this.position){ 221 _this.position = 0; 222 } 223 _this.setNavigation(_this.position); 224 _this.option.animation = false; 225 _this.playAuto(); 226 _this.debug("showNext::complete();"); 227 _this.debug("CURRENT="+_this.position); 228 } 229 }); 230 }else if(offset < 0){ 231 var tmp_position = _this.position; 232 //䏿¦è¡¨ç¤ºä¸ä»¥å¤å ¨ã¦é表示 233 $("#coverWrap").find(">a").not(":last").find(">img").css({opacity:0}
233); 234 //é åºå ¥ãæ¿ã 235 for(var i = 0; i < len; i++){ 236 _this.wrapper.find(">a:first").appendTo(_this.wrapper); 237 _this.wrapper.find(">a:last>img").css({"opacity": 0}); 238 tmp_position--; 239 } 240 //ä½ç½®ã»ãã 241 _this.setImagePosition(); 242 _this.wrapper.find("a:last>img").animate({"opacity": 1}, {duration: _this.option.duration, easing: _this.option.easing, complete: function(){ 243 _this.wrapper.find(">a").not(":last").find(">img").css({"opacity": 1}); 244 _this.position = tmp_position; 245 if(_this.position < 0){ 246 _this.position = (_this.option.length-1); 247 } 248 _this.option.animation = false; 249 _this.setNavigation(_this.position); 250 _this.playAuto(); 251 } 252 }); 253 }else{ 254 _this.option.animation = false; 255 } 256 } 257 } 258 ,setNavigation: function(pos){ 259 $(".nav li a").removeClass("active"); 260 $(".nav li a:eq("+pos+")").addClass("active"); 261 } 262 ,addNaviEvent: function(ev){ 263 var _this = this; 264 if(ev == "02"){ 265 //丸ãã¿ã³ 266 var nav = $(".nav>ol>li>a"); 267 //ããã®widthãè¨å® 268 var navWidth = 0; 269 nav.each(function(){ 270 navWidth += $(this).outerWidth() + parseInt($(this).parent().css("marginRight").replace("px", ""))+1; 271 }); 272 $(".nav").width(navWidth) 273 //ä½ç½®èª¿æ´ 274 $(".nav").css({"margin-left": -((13*_this.option.length)/2)}); 275 //ã¤ã³ããã¯ã¹ãã»ãã 276 nav.each(function(idx){ 277 $(this).data({index:idx}); 278 }) 279 //ã¤ãã³ãè¨å® 280 $(".nav>ol>li>a").on('click', {obj:_this}, _this.naviEventHandler); 281 }else if(ev == "03"){ 282 //ã¢ãã¼ 283 $("#coverLeft, #coverRight").css({display: 'block'}); 284 $("#coverLeft").on("click", {obj:_this}, _this.prevEventHandler); 285 $("#coverRight").on("click", {obj:_this}, _this.nextEventHandler); 286 } 287 } 288 ,removeNaviEvent: function(ev){ 289 var _this = this; 290 if(ev == "02"){ 291 $(".nav>ol>li>a").off('click'); 292 }else if(ev == "03"){ 293 $("#coverLeft").off("click"); 294 $("#coverRight").off("click"); 295 } 296 } 297 ,naviEventHandler: function(e){ 298 var _this = e.data.obj; 299 _this.slideToPage($(this).data("index")); 300 e.stopPropagation(); 301 e.preventDefault(); 302 } 303 ,prevEventHandler: function(e){ 304 var _this = e.data.obj; 305 _this.showPrev(); 306 e.stopPropagation(); 307 e.preventDefault(); 308 } 309 ,nextEventHandler: function(e){ 310 var _this = e.data.obj; 311 _this.showNext(); 312 e.stopPropagation(); 313 e.preventDefault(); 314 } 315 //windowãªãµã¤ãºã¤ãã³ã 316 ,resizeHandler: function(e){ 317 var _this = e.data.obj; 318 //windowãå¤å®(IE対ç) 319 if(e.target.location){ 320 clearTimeout(coverAutoID); 321 _this.reset(); 322 } 323 } 324 ,debug: function(mes){ 325 if(this.option.debug){ 326 if($("#logger").length==0){ 327 $("body").append("<p id=\"logger\" style=\"position: absolute; background: #FFF; top:10px; left: 10px;\">"+mes+"</p>") 328 }else{ 329 $("#logger").append("<br />"+mes); 330 } 331 } 332 } 333 }; 334 //ãã§ã¼ããªãã¸ã§ã¯ã使 335 window.bEffectFade = bEffectFade; 336 337 338 //ã¨ãã§ã¯ãç¡ããªãã¸ã§ã¯ã使ï¼ãã§ã¼ããªãã¸ã§ã¯ããç¶æ¿ï¼ 339 bEffectNone = $.extend(true, {}, bEffectFade); 340 //åãæ¿ãç§æ°10åºå® 341 bEffectNone.option.duration = 10; 342 //reset()æ¸ãæã 343 bEffectNone.reset=function(){ 344 this.wrapper = $("#coverWrap"); 345 this.option.animation = false;
346 this.option.design = ($("#coverList").length>0 ? $("#coverList").attr("class").replace("design","") : '00'); 347 this.option.interval = cover_interval; 348 this.option.length = $("#coverWrap img").length; 349 this.option.viewWidth = $("#coverArea").width(); 350 this.option.offset = $("#coverArea").outerWidth(); 351 this.init(); 352 $(window).off('resize', this.resizeHandler); 353 $(window).on('resize', {obj:this}, this.resizeHandler); 354 } 355 window.bEffectNone = bEffectNone; 356}); 357 358})(window, jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.