Learn how to use jQuery at the Blog

Jason Graphix « visit

  • Added 10 months ago
  • 59 Lines of Code shown
  • 4 Links of Interest
http://jasongraphix.com
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to Jason Graphix - http://jasongraphix.com

$(document).ready(
	function() {

		// Easing formula for Portfolio Scroller
		$.easing.slider = function (x, t, b, c, d, s) {s = .8; if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;};


		// Portfolio Scroller
		$('#insertquarter').after('<ul id="proceed"><li class="prev"><a style="display:none;" href="#">Prev</a></li><li class="next"><a href="#">Next</a></li></ul>');
		$('#insertquarter li').each(function(i){
			$('#proceed li.next').before('<li class="p'+ i +'"><a href="#" onclick="$(\'#insertquarter\').trigger( \'goto\', [ ' + i + ' ] ); return false;">' + i + '</a></li>');
		});
		$('#proceed li.p0').addClass('active');

		$('#insertquarter').serialScroll({items:'li', prev:'#proceed li.prev a', next:'#proceed li.next a', offset:0, start:0, duration:1200, force:true, stop:true, lock:false, cycle:false, easing:'slider', jump: false,
		onBefore:function( e, elem, $pane, $items, pos ){
			var $prev = $('#proceed li.prev a'), $next = $('#proceed li.next a');
			$prev.add($next).show();
			if( pos <= 0 ) $prev.hide();
			else if( pos >= $items.length-1 ) $next.hide();
			$('#proceed li').removeClass('active');
			$('#proceed li.p' + pos).addClass('active');
		}
		});

		// Smoothly scroll to anchor links using ScrollTo.
		$.localScroll();


		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});

 		// Zebra-stripe tables
		$("table tbody").each(function() {
			$(this).removeClass("odd even");
			$("tr:odd", this).addClass("odd");
			$("tr:even", this).addClass("even");
		});
		
		// It's just for fun.
		$('#mainnav').append('<li class="stamp">...</li>');
		
		//IE6 Warning
		if($.browser.msie && parseInt($.browser.version) <= 6){
			$('body').prepend('<div class="unsupported"><strong>Warning:</strong> You are currently using Internet Explorer 6 or lower. While I have done my best to make sure the site does not break in your browser, I am not actively supporting it. Please upgrade your browser or consider switching to <a href="http://getfirefox.com/">Firefox</a> or <a href="http://google.com/chrome/">Chrome</a>. Thank you!</div>')
		}
		
		// Homepage hover effect for SXSW.
		$('#sxswrevelator').append('<img src="/static/images/sxsw09bug.png" class="sxswbug" alt="SXSW Bug" />');
		$("a#sxswrevelator").hover(
			function(){ 
				$('.avatar').animate( { opacity:".001" }, 200 );
			}, function(){
				$('.avatar').animate( { opacity:"1" }, 100 );
			});
	 

	}
);