Learn how to use jQuery at the Blog

Quadconnection Köpf « visit

  • Added 6 months ago
  • 101 Lines of Code shown
  • 1 Links of Interest
http://quadconnection.de/alternative-startseite.html
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 Quadconnection Köpf - http://quadconnection.de/alternative-startseite.html

$(document).ready(function(){
// Anchor sliding
	$("a.anchorLink").anchorAnimate()
// Little Navbar animation
$('#site_navigation ul li').hover(function(){
    $(this).find('span').animate({ 
        top: '5px'}, 200).animate({
        top: '15px'}, 100).animate({
        top: '10px'}, 50).animate({
        top: '15px'}, 25);
}, function(){
    $(this).find('span').animate({
        top: '25px'}, 100); 
	});
// External Links
$('a[rel="external"]').click( function() {
    window.open( $(this).attr('href') );
    return false;
    });

});
// Anchor Jumping
jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}




/**
* Styleswitch stylesheet switcher built on jQuery
* Under an Attribution, Share Alike License
* By Kelvin Luck ( http://www.kelvinluck.com/ )
**/

(function($)
{
	$(document).ready(function() {
			switchStylestyle("styles2");
			return false;
		var c = readCookie('style');
		if (c) switchStylestyle(c);
	});

	function switchStylestyle(styleName)
	{
		$('link[@rel*=style][title]').each(function(i) 
		{
			this.disabled = true;
			if (this.getAttribute('title') == styleName) this.disabled = false;
		});
		createCookie('style', styleName, 365);
	}
})(jQuery);
// cookie functions http://www.quirksmode.org/js/cookies.html
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function eraseCookie(name)
{
	createCookie(name,"",-1);
}
// /cookie functions