Signin  Pricing  Examples  Support

Libraries > home.js

home.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://songspub.com/javascripts/app/home.js

Function Explorer







Libraries on songspub.com


application.js

home.js

handlebars.js

jquery-1.7.2.min.js

jquery.columnizer.min.js

jquery.imagesloaded.min.js

jquery.mousewheel.min.js

jquery.smoothdivscroll-1.2.min.js

jquery.truncate.min.js

jquery-ui-1.8.18.min.js

modernizr.min.js

soundmanager2.min.js

homepage.js



Explore More


jquery.hoverIntent.js

jquery.lightbox-0.5.js

jquery.serialize.js

jquery.validate.js

home.js
				
var HOME = (function ($) {
	var app = {}, $el, on = "on",
        slow = 500, normal = 250, fast = 150, animating = false, timer = 6500,
        interval, $viewport, $caption, $slides,
        $arrow = '<em class="arrow"></em>';

	function init() {
		var $slideshow = $('.large-slideshow');

		$slides = $slideshow.find('li');
		$viewport = $slideshow.find('.viewport');
		$caption = $viewport.find('p');

		// Setup
		bootstrap($slides.first());

		// Events
		$slides.click(function (e) {
			//e.preventDefault();
			change($slides.filter('.' + on), $(this));
		});
		$slideshow.hover(function () {
			clearRequestInterval(interval);
		}, function () {
			interval = requestInterval(advance, timer);
		});

		$slides.each(function () {
			$(this).css("padding-top", ($(this).innerHeight() - $(this).children('h3').innerHeight()) / 2);
			$(this).css("padding-bottom", ($(this).innerHeight() - $(this).children('h3').innerHeight()) / 2);
			bootstrapLink($(this));
		});
	}
	function advance() {
		var $current = $slides.filter('.' + on),
          $next = $current.next();
		if ($next.length === 0) {
			$next = $slides.filter(':first');
		}
		change($current, $next);
	}
	function bootstrap($slide) {
		var $img = $slide.find('img').clone().css({ opacity: 0, zIndex: 80 }),
        link = $img.data('link'),
        caption = $img.data('caption');

		$viewport.append($img);

		if (link !== undefined) {
			caption = '<a href="' + link + '">' + caption + '</a>';
			$img = $img.wrap($("<a />", { href: link }));
		}

		$slide.append($arrow);
		$caption.css({ opacity: 0, bottom: '-34px' }).html(caption);
		$slide.addClass(on);

		$img.animate({ opacity: 1 }, fast, function () {
			$caption.animate({ bottom: 0, opacity: 1 }, fast);
			interval = requestInterval(advance, timer);
		});
	}
	function bootstrapLink($slide) {
		var $img = $slide.find('img').clone().css({ opacity: 0, zIndex: 80 }),
		link = $img.data('link'),
        $headline = $slide.find('h3');
		if (link !== undefined) {
			$headline.html('<a href="' + link + '">' + $headline.html() + '</a>');
		}
	}
	function change($current, $next) {
		if (animating || $next.hasClass(on)) {
			return;
		} else {
			animating = true;
		}

		var $cur_img = $viewport.find('img'),
        $next_img = $next.find('img').clone().css({ zIndex: 70 }),
        link = $next_img.data('link'),
        caption = $next_img.data('caption');

		if ($next.find('.arrow').length === 0) {
			$next.append($arrow);
		}

		$viewport.append($next_img);

		if (link !== undefined) {
			caption = '<a href="' + link + '">' + caption + '</a>';
			$next_img = $next_img.wrap($("<a />", { href: link }));
		}

		$caption.animate({ opacity: 0, bottom: '-34px' }, fast, function () {
			$current.removeClass(on);
			$cur_img.animate({
				opacity: 0, left: '-100%'
			}, slow, function () {
				$caption.html(caption).animate({
					opacity: 1, bottom: 0
				}, fast, function () {
					$cur_img.remove();
					$next_img.css({ zIndex: 80 });
					$next.addClass(on);
					animating = false;
				});
			});
		});
	}
	$(init);
	return app;
}(jQuery));


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z