This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Lazy Load for background Images</h1> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_mrraktQTCS1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_mufr0mmWYW1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_mr80snx79b1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_mrraktQTCS1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_msuei3sMTo1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_mtw7mhZsCe1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_msuei3sMTo1st5lhmo1_1280.jpg"></div> | |
<div data-background-image-url="https://s3-us-west-2.amazonaws.com/s.cdpn.io/25381/tumblr_muf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = jQuery.noConflict(); | |
function justifyTabs(){ | |
var count = $('.nav-tabs > li > a').length, // set how many tabs | |
allHeights = []; // create array holder for the heights of our tabs | |
$('.nav-tabs > li').each(function () { | |
$(this).css('width', 100 / count + '%'); // set WIDTH based on how many tabs we have | |
var itemHeight = $(this).outerHeight(); // get HEIGHT of this item | |
allHeights.push(itemHeight); // add item HEIGHT to array | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires jQuery and jQuery Easing | |
var $ = jQuery.noConflict(); | |
function smoothScroll(element, speed, effect, offset) { | |
$(element).bind('click', function (event) { | |
$('html, body').stop().animate({ | |
scrollTop: ($($(this).attr('href')).offset().top) - offset | |
}, speed, effect); | |
event.preventDefault(); | |
}); | |
} |