/** * wSlide 0.1 - http://www.webinventif.fr/wslide-plugin/ * * Rendez vos sites glissant ! * * Copyright (c) 2008 Julien Chauvin (webinventif.fr) * Licensed under the Creative Commons License: * http://creativecommons.org/licenses/by/3.0/ * * Date: 2008-01-27 */ (function($){$.fn.wslide=function(h){h=jQuery.extend({width:150,height:150,pos:1,col:1,effect:'swing',fade:false,horiz:false,autolink:true,duration:1500},h);function gogogo(g){g.each(function(i){var a=$(this);var e=a.attr('id');if(e==undefined){e='wslide'+i}$(this).wrap('
');a=$('#'+e+'-wrap');var b=a.find('ul li');var f=h.effect;if(jQuery.easing.easeInQuad==undefined&&(f!='swing'||f!='normal')){f='swing'}var g=h.width;var j=h.height;function resultante(a){var b=a;b=b.split('px');b=b[0];return Number(b)}var k=g-(resultante(b.css('padding-left'))+resultante(b.css('padding-right')));var l=j-(resultante(b.css('padding-top'))+resultante(b.css('padding-bottom')));var m=h.col;if(h.horiz){m=Number(b.length+1)}var n='';var o=Math.ceil(Number(b.length)/m);a.css('overflow','hidden').css('position','relative').css('text-align','left').css('height',j+'px').css('width',g+'px').css('margin','0').css('padding','0');a.find('ul').css('position','absolute').css('margin','0').css('padding','0').css('width',Number((m+0)*g)+'px').css('height',Number(o*j)+'px');b.css('display','block').css('overflow','hidden').css('float','left').css('height',l+'px').css('width',k+'px');b.each(function(i){var b=a.offset();var c=$(this).offset();$(this).attr('id',e+'-'+Number(i+1)).attr('rel',Number(c.left-b.left)+':'+Number(c.top-b.top));n+=' '+Number(i+1)+''});if(typeof h.autolink=='boolean'){if(h.autolink){a.after(' ')}}else if(typeof h.autolink=='string'){if($('#'+h.autolink).length){$('#'+h.autolink).html(n)}else{a.after('