mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8509 201d5d3c-b55e-5fd7-737f-ddc643e51545
9 lines
2 KiB
JavaScript
9 lines
2 KiB
JavaScript
/**
|
|
* @file slide_gallery.js
|
|
* @brief Slideshow type image gallery plugin
|
|
* @author NHN (developers@xpressengine.com)
|
|
**/
|
|
(function(k){var m=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={};this._thumbs={};this._current={}},API_SHOW_SLIDE:function(g,e){var b=this,a=e[0],c="@"+a,d,f,j,i,h,l;d=this.cast("GET_IMAGES",[a]);if(d.length){f=k("#zone_slide_gallery_"+a);i=f.find(".slide_gallery_placeholder").css("overflow","hidden");f.find(".slide_gallery_loading_text").remove();j=f.find(".slide_gallery_thumbnail_image_box").show();h=0;for(l=d.length;h<l;h++)d[h].$obj.clone().css({cursor:"pointer",
|
|
width:"60px",height:"60px",margin:"5px",opacity:0.5}).click({idx:h},function(c){b.cast("SET_SLIDE",[a,c.data.idx])}).appendTo(j);k("#zone_gallery_navigator_status_"+a).click(function(){j.toggle()});f.find(".__prev").click(function(){b.cast("PREV_SLIDE",[a]);return!1}).end().find(".__next").click(function(){b.cast("NEXT_SLIDE",[a]);return!1});this._holders[c]=i;this._thumbs[c]=j;this._current[c]=0;this.cast("SET_SLIDE",[a,0])}},_showSideSlide:function(g,e){var b,a;b=this.cast("GET_IMAGES",[g]);b.length&&
|
|
(a=this._current["@"+g]+e,a<0?a=b.length-1:a>=b.length&&(a=0),this.cast("SET_SLIDE",[g,a]))},API_NEXT_SLIDE:function(g,e){this._showSideSlide(e[0],1)},API_PREV_SLIDE:function(g,e){this._showSideSlide(e[0],-1)},API_SET_SLIDE:function(g,e){var b=e[0],a=e[1],c,d,f;c=this.cast("GET_IMAGES",[b]);if(c.length&&is_def(d=c[a]))this._current["@"+b]=a,k("#zone_gallery_navigator_status_"+b).text(a+1+"/"+c.length),this._thumbs["@"+b].find("img").eq(a).animate({opacity:1}).end().not(":eq("+a+")").animate({opacity:0.5}),
|
|
b=this._holders["@"+b],c=b.parent().innerWidth(),a=d.$obj.prop("width"),f=d.$obj.prop("height"),a>c-20&&(c-=20,f=Math.floor(f*(c/a)),a=c,d.$obj.css("cursor","pointer"),d.$obj.attr("rel","xe_gallery")),d.$obj.css({width:a,height:f,margin:"0 10px"}),b.empty().append(d.$obj)}}),i=xe.getApp("Gallery")[0];i&&i.registerPlugin(new m)})(jQuery);
|