/** * sexy lightbox - for jquery 1.3.2 * @name sexylightbox.v2.3.js * @author eduardo d. sada - http://www.coders.me/web-html-js-css/javascript/sexy-lightbox-2 * @version 2.3.4 * @date 10-nov-2009 * @copyright (c) 2009 eduardo d. sada (www.coders.me) * @license mit - http://es.wikipedia.org/wiki/licencia_mit * @example http://www.coders.me/ejemplos/sexy-lightbox-2/ */ jquery.bind = function(object, method){ var args = array.prototype.slice.call(arguments, 2); return function() { var args2 = [this].concat(args, $.makearray( arguments )); return method.apply(object, args2); }; }; (function($) { sexylightbox = { getoptions: function() { return { name : 'slb', zindex : 32000, color : 'black', find : 'sexylightbox', dir : 'sexyimages', emergefrom : 'top', background : 'bgsexy.png', backgroundie : 'bgsexy.gif', buttons : 'buttons.png', displayed : 0, showduration : 200, closeduration : 400, moveduration : 1000, moveeffect : 'easeinoutback', resizeduration: 1000, resizeeffect : 'easeinoutback', shake : { distance : 10, duration : 100, transition : 'easeinoutback', loops : 2 }, boxstyles : { 'width' : 486, 'height': 320 }, skin : { 'white' : { 'hexcolor': '#ffffff', 'captioncolor': '#000000', 'background-color': '#000000', 'opacity': 0.6 }, 'black' : { 'hexcolor': '#000000', 'captioncolor': '#ffffff', 'background-color': '#000000', 'opacity': 0.6 }, 'blanco': { 'hexcolor': '#ffffff', 'captioncolor': '#000000', 'background-color': '#000000', 'opacity': 0.6 }, 'negro' : { 'hexcolor': '#000000', 'captioncolor': '#ffffff', 'background-color': '#000000', 'opacity': 0.6 } } }; }, overlay: { create: function(options) { this.options = options; this.element = $('
'); this.element.css($.extend({}, { 'position' : 'absolute', 'top' : 0, 'left' : 0, 'opacity' : 0, 'display' : 'none', 'z-index' : this.options.zindex }, this.options.style)); this.element.bind('click', $.bind(this, function(obj, event) { if (this.options.hideonclick) { if (this.options.callback) { this.options.callback(); } else { this.hide(); } } event.preventdefault(); })); this.hidden = true; this.inject(); }, inject: function() { this.target = $(document.body); this.target.append(this.element); //if((browser.engine.trident4 || (browser.engine.gecko && !browser.engine.gecko19 && browser.platform.mac))) if($.browser.msie && $.browser.version=="6.0") // no tengo tiempo para agregar la detecci?n del os que deber?a // haber estado integrada en jquery, pero que el est?pido de su creador no puso // me cago en john resig { var zindex = parseint(this.element.css('zindex')); if (!zindex) { zindex = 1; var pos = this.element.css('position'); if (pos == 'static' || !pos) { this.element.css({'position': 'relative'}); } this.element.css({'zindex': zindex}); } // diossss por diosss, pongan funciones ?tiles en jquery, // no todo es selectores! la puta madre, lo que hay que hacer // para detectar si una variable est? definida: zindex = (!!(this.options.zindex || this.options.zindex === 0) && zindex > this.options.zindex) ? this.options.zindex : zindex - 1; if (zindex < 0) { zindex = 1; } this.shim = $(''); this.image = $('#'+id); this.image.css({ 'width' : size['width']-14, 'height' : size['height'], 'background' : size['background'] || '#ffffff' }).attr('src', src); this.contenedor.css({ 'background' : 'none' }); }, showloading: function() { this.background.empty().removeattr('style').css({'width':'auto', 'height':'auto'}); this.contenido.empty().css({ 'background-color' : 'transparent', 'padding' : '0px', 'width' : 'auto' }); this.contenedor.css({ 'background' : 'url('+this.options.dir+'/'+this.options.color+'/loading.gif) no-repeat 50% 50%' }); this.contenido.empty().css({ 'background-color': 'transparent', 'padding' : '0px', 'width' : 'auto' }); this.replacebox($.extend(this.options.boxstyles, {'resize' : 1})); }, parsequery: function (query) { if( !query ) return {}; var params = {}; var pairs = query.split(/[;&]/); for ( var i = 0; i < pairs.length; i++ ) { var pair = pairs[i].split('='); if ( !pair || pair.length != 2 ) continue; params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' '); } return params; }, shake: function() { var d=this.options.shake.distance; var l=this.wrapper.position(); l=l.left; for(x=0;x