Learn how to use jQuery at the Blog

Kaisology « visit

  • Added 11 months ago
  • 62 Lines of Code shown
  • 3 Links of Interest
http://kaisology.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 Kaisology - http://kaisology.com

  //noConflict, using jquery with other libraries
  jQuery.noConflict();

  //automated Coda Slider
  var theInt = null;
  var jQuerycrosslink, jQuerynavthumb;
  var curclicked = 0;

  theInterval = function(cur){
  	clearInterval(theInt);

  	if( typeof cur != 'undefined' )
  		curclicked = cur;

  	jQuerycrosslink.removeClass("active-thumb");
  	jQuerynavthumb.eq(curclicked).parent().addClass("active-thumb");
		jQuery(".stripNav ul li a").eq(curclicked).trigger('click');

		theInt = setInterval(function(){
			jQuerycrosslink.removeClass("active-thumb");
			jQuerynavthumb.eq(curclicked).parent().addClass("active-thumb");
			jQuery(".stripNav ul li a").eq(curclicked).trigger('click');
			curclicked++;
			if( 2 == curclicked )
				curclicked = 0;

		}, 3000);
	};

	jQuery(function(){
		jQuery("#main-photo-slider").codaSlider();

		jQuerynavthumb = jQuery(".nav-thumb");
		jQuerycrosslink = jQuery(".cross-link");

		jQuerynavthumb
		.click(function() {
			var jQuerythis = jQuery(this);
			theInterval(jQuerythis.parent().attr('href').slice(1) - 1);
			return false;
		});

		theInterval();
	});

  //animated ScrollTo
  jQuery(document).ready(function(){
    jQuery('a[href*=#]').click(function() {
    	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        	&& location.hostname == this.hostname) {
        	  var jQuerytarget = jQuery(this.hash);
        	  jQuerytarget = jQuerytarget.length && jQuerytarget
        	  || jQuery('[name=' + this.hash.slice(1) +']');
        	  if (jQuerytarget.length) {
        		var targetOffset = jQuerytarget.offset().top;
        		jQuery('html,body')
        		.animate({scrollTop: targetOffset}, 1000);
        	   return false;
    	  }
    	}
    });
  });