D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
www
/
partymaker.in
/
assets
/
front_end
/
js
/
Filename :
jquery.viewbox.min.js
back
Copy
!function(e){e.fn.viewbox=function(t){function n(e){if(!y){u();var n=e.attr("href"),i=t.setTitle&&e.attr("title")?e.attr("title"):"";n?c(n)?(b=e,h(n,i)):l(n)&&(b=e,g(n,i)):(b=e,g(e,i))}}function i(n,i){var a,r,c=o("body"),l=o("content");n&&l.width(n),i&&l.height(i),m?(a=c.width(),r=c.height()):(m=!0,e("body").append(p),p.show(),a=c.width(),r=c.height(),p.hide(),p.fadeIn(t.openDuration)),c.css({"margin-left":-a/2,"margin-top":-r/2})}function o(e){return p.find(".viewbox-"+e)}function a(e,t){o(e).html(t)}function r(){var e=-1;return b&&f.each(function(t){return b.is(this)?(e=t,!1):void 0}),e}function c(e){return e.match(/(png|jpg|jpeg|gif)(\?.*)?$/i)}function l(t){return t.match(/^#.+$/i)&&e(t).length}function s(e){return e.get(0).complete}function d(e){e?x.appendTo(o("body")):x.detach()}function v(t){var n=e('<div class="viewbox-button-default viewbox-button-'+t+'"></div>'),i=window.location.pathname+window.location.search+"#viewbox-"+t+"-icon";return n.appendTo(p).get(0).insertAdjacentHTML("afterbegin",'<svg><use xlink:href="'+i+'"/></svg>'),n}function g(t,n){var r=e(t),c=e('<div class="viewbox-content-placeholder"></div>');r.before(c),m&&p.trigger("viewbox.close"),a("content",""),a("header",n),o("content").append(r),i("auto","auto"),k.push({placeholder:c,content:r})}function u(){for(var e;k.length;)e=k.shift(),e.placeholder.before(e.content),e.placeholder.detach()}function h(n,r){var c=e('<img class="viewbox-image" alt="">').attr("src",n);s(c)||d(!0),a("content",""),a("header",r),i();var l=o("body"),v=0,g=o("content"),u=window.setInterval(function(){if(!s(c)&&1e3>v)return void v++;window.clearInterval(u),d(!1),e("body").append(c);var n=l.width()-g.width()+2*t.margin,i=l.height()-g.height()+2*t.margin,o=e(window).width()-n,a=e(window).height()-i,r=c.width(),h=c.height();c.detach(),r>o&&(h=h*o/r,r=o),h>a&&(r=r*a/h,h=a),y=!0,l.animate({"margin-left":-(r+n)/2+t.margin,"margin-top":-(h+i)/2+t.margin},t.resizeDuration),g.animate({width:r,height:h},t.resizeDuration,function(){g.append(c),y=!1})},s(c)?0:200)}function w(e,t){if("function"==typeof t){var n,i,o=150,a=100,r=300;e.on("touchstart",function(e){var t=e.originalEvent.changedTouches[0];n={x:t.pageX,y:t.pageY},i=(new Date).getTime()}),e.on("touchend",function(e){var c=e.originalEvent.changedTouches[0],l="none",s=(new Date).getTime()-i,d={x:c.pageX,y:c.pageY},v={x:d.x-n.x,y:d.y-n.y};r>=s&&(Math.abs(v.x)>=o&&Math.abs(v.y)<=a?l=v.x<0?"left":"right":Math.abs(v.y)>=o&&Math.abs(v.x)<=a&&(l=v.y<0?"up":"down")),t.call(this,l)})}}"undefined"==typeof t&&(t={}),t=e.extend({template:'<div class="viewbox-container"><div class="viewbox-body"><div class="viewbox-header"></div><div class="viewbox-content"></div><div class="viewbox-footer"></div></div></div>',loader:'<div class="loader"><div class="spinner"><div class="double-bounce1"></div><div class="double-bounce2"></div></div></div>',setTitle:!0,margin:20,resizeDuration:400,openDuration:200,closeDuration:200,closeButton:!0,navButtons:!0,closeOnSideClick:!0,nextOnContentClick:!1,useGestures:!0},t);var b,f=e(this),p=e(t.template),x=e(t.loader),m=!1,y=!1,k=[];return e("#viewbox-sprite").length||e("body").get(0).insertAdjacentHTML("afterbegin",'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="viewbox-sprite" style="display:none"><symbol id="viewbox-close-icon" viewBox="0 0 50 50"><path d="M37.304 11.282l1.414 1.414-26.022 26.02-1.414-1.413z"/><path d="M12.696 11.282l26.022 26.02-1.414 1.415-26.022-26.02z"/></symbol><symbol id="viewbox-prev-icon" viewBox="0 0 50 50"><path d="M27.3 34.7L17.6 25l9.7-9.7 1.4 1.4-8.3 8.3 8.3 8.3z"/></symbol><symbol id="viewbox-next-icon" viewBox="0 0 50 50"><path d="M22.7 34.7l-1.4-1.4 8.3-8.3-8.3-8.3 1.4-1.4 9.7 9.7z"/></symbol></svg>'),p.bind("viewbox.open",function(t,i){Number.isInteger(i)&&f.length?n(f.eq(i>=0&&i<f.length?i:0)):i&&i.tagName?n(e(i)):f.length&&n(f.eq(0))}),p.bind("viewbox.next",function(e){if(!(f.length<=1)){var t=r()+1;t>=f.length&&(t=0),n(f.eq(t))}}),p.bind("viewbox.prev",function(e){if(!(f.length<=1)){var t=r()-1;0>t&&(t=f.length-1),n(f.eq(t))}}),p.bind("viewbox.close",function(e){m&&p.fadeOut(t.closeDuration,function(){m=!1})}),f.filter("a").click(function(){return p.trigger("viewbox.open",[this]),!1}),o("body").click(function(e){e.stopPropagation(),t.nextOnContentClick&&p.trigger("viewbox.next")}),t.closeButton&&v("close").click(function(e){e.stopPropagation(),p.trigger("viewbox.close")}),t.navButtons&&f.length>1&&(v("next").click(function(e){e.stopPropagation(),p.trigger("viewbox.next")}),v("prev").click(function(e){e.stopPropagation(),p.trigger("viewbox.prev")})),t.closeOnSideClick&&p.click(function(){p.trigger("viewbox.close")}),t.useGestures&&"ontouchstart"in document.documentElement&&w(p,function(e){switch(e){case"left":p.trigger("viewbox.next");break;case"right":p.trigger("viewbox.prev")}}),p}}(jQuery);