Learn how to use jQuery at the Blog

nmstudio « visit

  • Added 9 months ago
  • 86 Lines of Code shown
  • 3 Links of Interest
http://nmstudio.pl
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 nmstudio - http://nmstudio.pl

// http://www.robertpenner.com/easing/ 
jQuery.easing['easeOutBounce'] = function(x, t, b, c, d) {
	if ((t /= d) < (1 / 2.75)) return c * (7.5625 * t * t) + b;
	else if (t < (2 / 2.75)) return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
	else if (t < (2.5 / 2.75)) return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
	else return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
};
var c = $.cookie('showTop');
$(function() {
	$('#project div a').facebox(); 
	//karuzela
	$('#thumbs').wrap('<div id="karuzela"><div></div></div>').parent().parent().prepend('<button class="prev">&#171;</button>\n<button class="next">&#187;</button>');
	$('#karuzela div').jCarouselLite({
		speed: 950,
		scroll: 2,
		easing: 'easeOutBounce'
	});
	$('button').focus(function() {
		this.blur();
	}); 
	//portfolio
	var wrap = $('#project').wrap('<div></div>').parent();
	wrap.css({
		position: 'relative',
		overflow: 'hidden',
		height: '' + $('#project').innerHeight() + 'px'
	});
	$('#thumbs a').each(function() {
		$(this).click(function() {
			$('#thumbs .active').removeAttr('class');
			$(this).addClass('active');
			$('#over').remove();
			wrap.append('<div id="over"><span>..</span></div>');
			var lnk = $(this).attr('href') + '/ajax';
			$.get(lnk,
			function(r) {
				$('#project').html(r);
				var src = $('#project').find('img');
				src.load(function() {
					$('#over').fadeOut(450,
					function() {
						$(this).remove();
					}).find('span').remove();
					wrap.animate({
						height: '' + $('#project').innerHeight() + 'px'
					},
					650);
					$('#project div a').facebox(); //??
				});
			});
			return false;
		});
		var s = $(this).find('cite');
		s.css('display', 'none');
		$(this).bind('mouseenter',
		function() {
			s.slideDown(250);
		}).bind('mouseleave',
		function() {
			s.slideUp(250);
		});
	}); 
	//top panel
	$('#contact').css('display', 'none');
	var a = $('<a href="#">kontakt</a>');
	$('#header div').append(a);
	$('#header a').click(function() {
		if ($("#contact").is(':hidden')) {
			$('#contact').slideDown('fast');
			$(this).removeClass('togg'); 
			$.cookie('showTop', 'expanded');
		} else {
			$('#contact').slideUp('fast');
			$(this).addClass('togg'); 
			$.cookie('showTop', 'collapsed');
		}
		return false;
	});
	if(c == 'collapsed') {
		$('#contact').hide();
		a.addClass('togg');
	} 
});
$(window).bind('load', function() {
	if(!c) $('#contact').slideDown('slow');
});