PageSourceSearch

https://shijo-bettei.jp/js/jquery.backstretch.js

js shijo-bettei.jp collected 2026-09-30 17:16:06 UTC 4,915 bytes, 4 lines download raw bytes

1/*! Backstretch - v2.0.4 - 2013-06-19
2* http://srobbin.com/jquery-plugins/backstretch/
3* Copyright (c) 2013 Scott Robbin; Licensed MIT */(function($,window,undefined){"use strict";$.fn.backstretch=function(t,n){return(t===undefined||t.length===0)&&$.error("No images were supplied for Backstretch"),$(window).scrollTop()===0&&window.scrollTo(0,0),this.each(function(){var s=$(this),i=s.data("backstretch");if(i){if(typeof t=="string"&&typeof i[t]=="function"){i[t](n);return}n=$.extend(i.options,n),i.destroy(!0)}i=new Backstretch(this,t,n),s.data("backstretch",i)})},$.backstretch=function(t,n){return $("body").backstretch(t,n).data("backstretch")},$.expr[":"].backstretch=function(t){return $(t).data("backstretch")!==undefined},$.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0,before:"",after:""};var styles={wrap:{left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},img:{position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999}},Backstretch=function(t,n,s){this.options=$.extend({},$.fn.backstretch.defaults,s||{}),this.images=$.isArray(n)?n:[n],$.each(this.images,function(){$("<img />")[0].src=this}),this.isBody=t===document.body,this.$container=$(t),this.$root=this.isBody?$(supportsFixedPosition?window:document):this.$container;var i=this.$container.children(".backstretch").first();if(this.$wrap=i.length?i:$('<div class="backstretch"></div>').css(styles.wrap).appendTo(this.$container),!this.isBody){var r=this.$container.css("position"),o=this.$container.css("zIndex");this.$container.css({position:r==="static"?"relative":r,zIndex:o==="auto"?0:o,background:"none"}),this.$wrap.css({zIndex:-999998})}this.$wrap.css({position:this.isBody&&supportsFixedPosition?"fixed":"absolute"}),this.index=0,this.show(this.index),$(window).on("resize.backstretch",$.proxy(this.resize,this)).on("orientationchange.backstretch",$.proxy(function(){this.isBody&&window.pageYOffset===0&&(window.scrollTo(0,1),this.resize())},this))};Backstretch.prototype={resize:function(){try{var t={left:0,top:0},n=this.isBody?this.$root.width():this.$root.innerWidth(),s=n,i=this.isBody?window.innerHeight?window.innerHeight:this.$root.height():this.$root.innerHeight(),r=s/this.$img.data("ratio"),o;r>=i?(o=(r-i)/2,this.options.centeredY&&(t.top="-"+o+"px")):(r=i,s=r*this.$img.data("ratio"),o=(s-n)/2,this.options.centeredX&&(t.left="-"+o+"px")),this.$wrap.css({width:n,height:i}).find("img:not(.deleteable)").css({width:s,height:r}).css(t)}catch(a){}return this},show:function(newIndex){if(!(Math.abs(newIndex)>this.images.length-1)){var self=this,oldImage=self.$wrap.find("img").addClass("deleteable"),evtOptions={relatedTarget:self.$container[0]};return self.$container.trigger($.Event("backstretch.before",evtOptions),[self,newIndex]),this.index=newIndex,clearInterval(self.interval),self.$img=$("<img />").addClass("slide_img"+newIndex).css(styles.img).bind("load",function(e){var imgWidth=this.width||$(e.target).width(),imgHeight=this.height||$(e.target).height();$(this).data("ratio",imgWidth/imgHeight),$(this).fadeIn(self.options.speed||self.options.fade,function(){oldImage.remove(),self.paused||self.cycle(),$(["after","show"]).each(function(){self.$container.trigger($.Event("backstretch."+this,evtOptions),[self,newIndex])}),eval(self.options.after+"("+newIndex+")")}),self.resize()}).appendTo(self.$wrap),eval(self.options.before+"("+newIndex+")"),self.$img.attr("src",self.images[newIndex]),self}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(this.index===0?this.images.length-1:this.index-1)},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this.next(),this},cycle:function(){return this.images.length>1&&(clearInterval(this.interval),this.interval=setInterval($.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(t){$(window).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),t||this.$wrap.remove(),this.$container.removeData("backstretch")}};var supportsFixedPosition=function(){var t=navigator.userAgent,n=navigator.platform,s=t.match(/AppleWeb
vendor: 628 bytes, lines 3-4
3Kit\/([0-9]+)/),i=!!s&&s[1],r=t.match(/Fennec\/([0-9]+)/),o=!!r&&r[1],a=t.match(/Opera Mobi\/([0-9]+)/),d=!!a&&a[1],h=t.match(/MSIE ([0-9]+)/),c=!!h&&h[1];return!((n.indexOf("iPhone")>-1||n.indexOf("iPad")>-1||n.indexOf("iPod")>-1)&&i&&i<534||window.operamini&&{}.toString.call(window.operamini)==="[object OperaMini]"||a&&d<7458||t.indexOf("Android")>-1&&i&&i<533||o&&o<6||"palmGetResource"in window&&i&&i<534||t.indexOf("MeeGo")>-1&&t.indexOf("NokiaBrowser/8.5.0")>-1||c&&c<=6)}()})(jQuery,window);
4//# sourceMappingURL=/s/files/1/0580/4775/8485/t/15/assets/jquery.backstretch.js.map?v=17864180760973847793&_accept=image/webp

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.