$(document).ready(function(){ //menu $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 }); //featured $("#featured").minitabs('slow', 'fade'); //links $('#sidebar .widget li a').hover(function() { //mouse in $(this).animate({ paddingLeft: '15px' }, 200); }, function() { //mouse out $(this).animate({ paddingLeft: 3 }, 200); }); //rss $('#rss').hover(function() { //mouse in $(this).animate({ top: 0 }, 200); }, function() { //mouse out $(this).animate({ top: '-20' }, 200); }); }); //kedua jQuery.fn.topLink = function(settings) { settings = jQuery.extend({ min: 1, fadeSpeed: 200, ieOffset: 50 }, settings); return this.each(function() { //listen for scroll var el = $(this); el.css('display','none'); //in case the user forgot $(window).scroll(function() { if(!jQuery.support.hrefNormalized) { el.css({ 'position': 'absolute', 'top': $(window).scrollTop() + $(window).height() - settings.ieOffset }); } if($(window).scrollTop() >= settings.min) { el.fadeIn(settings.fadeSpeed); } else { el.fadeOut(settings.fadeSpeed); } }); }); }; $(document).ready(function() { $('#top-link').topLink({ min: 400, fadeSpeed: 500 }); //smoothscroll $('#top-link').click(function(e) { e.preventDefault(); $.scrollTo(0,500); }); });