$(document).ready(function(){ $.tabs("tabs"); $("#promos").jKwick({min: 145, max: 525, mid: 272}); $("#teknet").hover( function (){ $("div.utils-box").hide(); $("div#teknetbox").fadeIn(); }, function (){ $("div#teknetbox").fadeOut(); }); $("#logins").hover( function (){ $("div.utils-box").hide(); $("div#loginsbox").fadeIn(); }, function (){ $("div#loginsbox").fadeOut(); }); $("#global").hover( function (){ $("div.utils-box").hide(); $("div#globalbox").fadeIn(); }, function (){ $("div#globalbox").fadeOut(); }); $("#subscribeshow").hover( function (){ $("div.utils-box").hide(); $("div#subscribebox").fadeIn(); }, function (){ $("div#subscribebox").fadeOut(); }); }); // are YOU ready? $(document).ready(function(){ $("#promos li").hover(function(){ $(this).addClass("biggertext"); $(this).children('span.homeslider').animate({bottom:0},100); $(this).children('p.link').fadeTo('fast', 1.0); },function(){ $(this).removeClass("biggertext"); $(this).children('span.homeslider').animate({bottom:-50},100); $(this).children('p.link').fadeTo('fast', 0.0); }); }); // you STILL ready? $.tabs = function(containerId, start) { var ON_CLASS = 'on'; var id = '#' + containerId; var i = (typeof start == "number") ? start - 1 : 0; $(id + '>div:lt(' + i + ')').add(id + '>div:gt(' + i + ')').hide(); $(id + '>ul>li:nth-child(' + i + ')').addClass(ON_CLASS); $(id + '>ul>li>a').click(function() { if (!$(this.parentNode).is('.' + ON_CLASS)) { var re = /([_\-\w]+$)/i; var target = $('#' + re.exec(this.href)[1]); if (target.size() > 0) { $(id + '>div:visible').hide(); target.show(); $(id + '>ul>li').removeClass(ON_CLASS); $(this.parentNode).addClass(ON_CLASS); } else { } } return false; }); }; $.fn.jKwick = function(o) { o = $.extend({ min: 0, // Minimum size of each element. All other elements other than the currently hovered element get this size max: 0, // Maximum size of the element. The element that is currently hovered gets this size mid: 0, // Middle size of each element. All the elements get this size when no element is hovered upon speed: 100, // Speed with which the animation should be applied while moving the focus for the element easing: "linear" // The easing effect to be applied to the animation that moves the element's focus }, o || {}); var $ul = $("ul", this), $li = $("li", $ul), liLength = $li.length, $old = null, $new = null, first = true, running = false, noop = function() {}; $li.hover(function() { if(!running) { running = true; $new = $(this); if(first) { $new.animate({width: o.max}, o.speed); $li.not(this).animate({width: o.min}, o.speed, function() { $old = $new; first = running = false; }); } else { var newWidth = $new.width(), oldWidth = $old.width(); $new.animate( { width: o.max }, { duration: o.speed, easing: o.easing, step: function(n) { $old.width(Math.ceil( oldWidth - (n-newWidth))); }, complete: function() { $old = $new; running = false; } }); } } }, noop); $ul.hover(noop, function() { $li.animate({width: o.mid}, o.speed); first = true; }); };