added option for fixedAs, which will allow for fixing a globalnav as header or footer

This commit is contained in:
scottjehl 2010-09-14 12:26:48 -04:00
parent 91ca456a82
commit 8d07b57b8a

View file

@ -7,9 +7,12 @@
(function($){
$.fn.globalnav = function(settings){
return $(this).each(function(){ //there should only ever be one of these... is each necessary?
var o = $.extend({
fixedAs: 'footer'
},settings);
//wrap it with footer classes
var globalnav = $(this).wrap('<div class="ui-footer ui-bar-a"></div>');
var globalnav = $(this).wrap('<div class="ui-bar-a"></div>').addClass(o.fixedAs == 'footer' ? 'ui-footer' : 'ui-header');
//apply fixed footer markup to ui-footer
$(document).fixHeaderFooter();