Sha256: 148808f14d9a9224609d5d1d36d06e1776ebb049cee44d435c17267b52c57c84

Contents?: true

Size: 956 Bytes

Versions: 144

Compression:

Stored size: 956 Bytes

Contents

$('a[rel=tooltip]').tooltip({
	'placement': 'bottom'
});


$('.navbar a, .subnav a').smoothScroll();


(function ($) {

	$(function(){

		// fix sub nav on scroll
		var $win = $(window),
				$body = $('body'),
				$nav = $('.subnav'),
				navHeight = $('.navbar').first().height(),
				subnavHeight = $('.subnav').first().height(),
				subnavTop = $('.subnav').length && $('.subnav').offset().top - navHeight,
				marginTop = parseInt($body.css('margin-top'), 10);
				isFixed = 0;

		processScroll();

		$win.on('scroll', processScroll);

		function processScroll() {
			var i, scrollTop = $win.scrollTop();

			if (scrollTop >= subnavTop && !isFixed) {
				isFixed = 1;
				$nav.addClass('subnav-fixed');
				$body.css('margin-top', marginTop + subnavHeight + 'px');
			} else if (scrollTop <= subnavTop && isFixed) {
				isFixed = 0;
				$nav.removeClass('subnav-fixed');
				$body.css('margin-top', marginTop + 'px');
			}
		}

	});

})(window.jQuery);

Version data entries

144 entries across 72 versions & 2 rubygems

Version Path
card-mod-bootstrap-0.18.1 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.18.1 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.18.0 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.18.0 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.17.0 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.17.0 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.16.0 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.16.0 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.6 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.6 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.5 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.5 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.4 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.4 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.3 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.3 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.1.2 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.1.2 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js
card-mod-bootstrap-0.15.2.pre1 vendor/bootswatch/docs/2/js/bootswatch.js
card-mod-bootstrap-0.15.2.pre1 vendor/bootswatch/docs/2/swatchmaker/test/bootswatch.js