Learn how to use jQuery at the Blog

Webdesign Veteran « visit

  • Added 9 months ago
  • 54 Lines of Code shown
  • 1 Links of Interest
http://webdesignveteran.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 Webdesign Veteran - http://webdesignveteran.com

$(document).ready(function() {

	if(/MSIE/.test(navigator.userAgent)){
		$("#list li").each(
			function() { $(this).children(".hover").css({ opacity: 0 }) }
		);
	}

	$("#list li .hover").each(
		function() {
			$(this).hover(
				function() { $(this).fadeTo(320, 1) },
				function() { if(!$(this).hasClass("current")) $(this).fadeTo(320, 0) }
			);
		}
	);

	$("#list li .hover").each(
		function() {
			$(this).bind("click",
				function() {
					$("#list li .hover").each(
						function() {
							if($(this).hasClass("current")){
								$(this).removeClass("current");
								$(this).fadeTo(320, 0);
							}
						}
					);
					$(this).addClass("current");
				}
			);
		}
	);

	$("#list li:first .hover").css({ opacity: 1 }).addClass("current");

	jQuery(document).ready(function() {
	    jQuery("#detail ol").jcarousel({
	        scroll: 1,
	        initCallback: mycarousel_initCallback,
	        buttonNextHTML: null,
	        buttonPrevHTML: null
	    });
	});

	function mycarousel_initCallback(carousel) {
	    jQuery("#list .hover").bind("click", function() {
	        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("id")));
	        return false;
	    });
	}
	
});