Difference between revisions of "Jforeground.js"
From Joomla! Documentation
m (duh, wrong target) |
m (sticky nav) |
||
Line 2: | Line 2: | ||
$('li#p-Help a:first').prepend('<div class="drop-icon"><i class="fa fa-life-ring fa-fw"></i></div>') | $('li#p-Help a:first').prepend('<div class="drop-icon"><i class="fa fa-life-ring fa-fw"></i></div>') | ||
$('li#p-Browse a:first').prepend('<div class="drop-icon"><i class="fa fa-search fa-fw"></i></div>') | $('li#p-Browse a:first').prepend('<div class="drop-icon"><i class="fa fa-search fa-fw"></i></div>') | ||
+ | |||
+ | $('li#p-sidebar-Learn a:first').prepend('<div class="drop-icon"><i class="fa fa-university fa-fw"></i></div>') | ||
+ | $('li#p-sidebar-Help a:first').prepend('<div class="drop-icon"><i class="fa fa-life-ring fa-fw"></i></div>') | ||
+ | $('li#p-sidebar-Browse a:first').prepend('<div class="drop-icon"><i class="fa fa-search fa-fw"></i></div>') | ||
+ | |||
+ | jQuery(document).ready(function(){ | ||
+ | $(window).bind('scroll', function() { | ||
+ | var navHeight = 45; | ||
+ | if ($(window).scrollTop() > navHeight) { | ||
+ | $('#bottom-nav').addClass('fixed'); | ||
+ | $('#navwrapper').css('bottom-margin', '5em'); | ||
+ | } | ||
+ | else { | ||
+ | $('#bottom-nav').removeClass('fixed'); | ||
+ | $('#navwrapper').css('bottom-margin', '1.875em'); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
if ( mw.config.get( 'wgIsArticle' ) ) { | if ( mw.config.get( 'wgIsArticle' ) ) { |
Revision as of 14:30, 3 April 2015
$('li#p-Learn a:first').prepend('<div class="drop-icon"><i class="fa fa-university fa-fw"></i></div>')
$('li#p-Help a:first').prepend('<div class="drop-icon"><i class="fa fa-life-ring fa-fw"></i></div>')
$('li#p-Browse a:first').prepend('<div class="drop-icon"><i class="fa fa-search fa-fw"></i></div>')
$('li#p-sidebar-Learn a:first').prepend('<div class="drop-icon"><i class="fa fa-university fa-fw"></i></div>')
$('li#p-sidebar-Help a:first').prepend('<div class="drop-icon"><i class="fa fa-life-ring fa-fw"></i></div>')
$('li#p-sidebar-Browse a:first').prepend('<div class="drop-icon"><i class="fa fa-search fa-fw"></i></div>')
jQuery(document).ready(function(){
$(window).bind('scroll', function() {
var navHeight = 45;
if ($(window).scrollTop() > navHeight) {
$('#bottom-nav').addClass('fixed');
$('#navwrapper').css('bottom-margin', '5em');
}
else {
$('#bottom-nav').removeClass('fixed');
$('#navwrapper').css('bottom-margin', '1.875em');
}
});
});
if ( mw.config.get( 'wgIsArticle' ) ) {
$(window).bind("load", function () {
var footer = $("footer.row");
var pos = footer.position();
var height = $(window).height();
height = height - pos.top;
height = height - footer.height();
if (height > 0) {
footer.css({
'position': 'fixed', 'bottom': '0', 'width': '100%'
});
}
});
}
/* AddThis script for social sharing do not remove */
mw.loader.load( 'https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5378f70766e02197&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' );
var addthis_share = {
url_transforms : {
shorten: {
twitter: 'bitly'
}
},
shorteners : {
bitly : {}
}
}