관리-도구
편집 파일: jquery.tabSlideOut-01.js
!function(t){t.fn.tabSlideOut=function(o){var a=t.extend({tabHandle:".handle-02",tabHandle1:".handle",speed:300,action:"click",tabLocation:"left",topPos:"200px",fixedPosition:!1,positioning:"fixed",pathToTabImage:null,imageHeight:null,imageWidth:null,onLoadSlideOut:!1},o||{});a.tabHandle=t(a.tabHandle);var n=this;a.fixedPosition===!0?a.positioning="fixed":a.positioning="fixed",!document.all||window.opera||window.XMLHttpRequest||(a.positioning="fixed"),null!=a.pathToTabImage&&a.tabHandle.css({background:"url("+a.pathToTabImage+") no-repeat",width:a.imageWidth,height:a.imageHeight}),a.tabHandle.css({display:"block",textIndent:"-99999px",outline:"none",position:"absolute"}),n.css({"line-height":"1",position:a.positioning});var e={containerWidth:parseInt(n.outerWidth(),10)+"px",tabWidth:parseInt(a.tabHandle.outerWidth(),10)+"px",tabHeight:parseInt(a.tabHandle.outerHeight(),10)+"px"};("top"===a.tabLocation||"bottom"===a.tabLocation)&&n.css({left:a.leftPos}),"top"===a.tabLocation&&(n.css({top:"-"+e.containerHeight}),a.tabHandle.css({bottom:"-"+e.tabHeight})),"bottom"===a.tabLocation&&(n.css({bottom:"-212px",position:"fixed"}),a.tabHandle.css({top:"-"+e.tabHeight})),("left"===a.tabLocation||"right"===a.tabLocation)&&(n.css({height:e.containerHeight,top:a.topPos}),a.tabHandle.css({top:0})),"left"===a.tabLocation&&(n.css({left:"-"+e.containerWidth}),a.tabHandle.css({right:"-"+e.tabWidth})),"right"===a.tabLocation&&(n.css({right:"-"+e.containerWidth}),a.tabHandle.css({left:"-"+e.tabWidth}),t("html").css("overflow-x","hidden")),a.tabHandle.click(function(t){t.preventDefault()});var i=function(){"top"===a.tabLocation?n.animate({top:"-"+e.containerHeight},a.speed).removeClass("open"):"left"===a.tabLocation?n.animate({left:"-"+e.containerWidth},a.speed).removeClass("open"):"right"===a.tabLocation?n.animate({right:"-"+e.containerWidth},a.speed).removeClass("open"):"bottom"===a.tabLocation&&n.animate({bottom:"-212px"},a.speed).removeClass("open")},s=function(){"top"==a.tabLocation?n.animate({top:"-3px"},a.speed).addClass("open"):"left"==a.tabLocation?n.animate({left:"-3px"},a.speed).addClass("open"):"right"==a.tabLocation?n.animate({right:"-3px"},a.speed).addClass("open"):"bottom"==a.tabLocation&&n.animate({bottom:"-3px"},a.speed).addClass("open")},c=function(){n.click(function(t){t.stopPropagation()}),t(document).click(function(){i()})},d=function(){a.tabHandle.click(function(t){n.hasClass("open")?i():s()}),c()},l=function(){n.hover(function(){s()},function(){i()}),a.tabHandle.click(function(t){n.hasClass("open")&&i()}),c()},p=function(){i(),setTimeout(s,500)};"click"===a.action&&d(),"hover"===a.action&&l(),a.onLoadSlideOut&&p()}}(jQuery);