/*! * Side Bar v1.0.1 * http://sideroad.secret.jp/ * * Copyright (c) 2009 sideroad * * Dual licensed under the MIT licenses. * Date: 2009-09-01 */ //Side Bar Plugin (function($) { $.fn.sidebar = function(options){ return this.each(function(){ options = options || {}; //default setting options = $.extend({ position: "left", width: 100, height: 200, injectWidth: 50, liMouseOver: { marginLeft: "5px" }, liMouseOut: { marginLeft: "0px" }, open : "mouseenter", close : "mouseleave" }, options); var m; var icss; var ccss = { height: options.height, width: options.width }; if(options.position == "left" || options.position == "right") { m = options.width - options.injectWidth; icss = { height: options.height, width: options.injectWidth }; ccss.top = ($(window).height()/2) - (options.height/2) + "px"; } else { m = options.height - options.injectWidth; icss = { height: options.injectWidth, width: options.width }; ccss.left = ($(window).width()/2) - (options.width/2) + "px"; } var bcss = { height: options.height, width: options.width }; var e = {}; var l = {}; ccss[options.position] = "-" + m + "px"; icss[options.position] = m + "px"; e[options.position] = 0; l[options.position] = "-" + m; //container var c = $("