mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-02 05:50:23 +00:00
39 lines
No EOL
927 B
JavaScript
Executable file
39 lines
No EOL
927 B
JavaScript
Executable file
/*
|
|
* jQuery Mobile Framework : "navbar" plugin
|
|
* Copyright (c) jQuery Project
|
|
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
|
* Note: Code is in draft form and is subject to change
|
|
*/
|
|
(function($, undefined ) {
|
|
$.widget( "mobile.navbar", $.mobile.widget, {
|
|
options: {
|
|
iconpos: 'top'
|
|
},
|
|
_create: function(){
|
|
var $navbar = this.element,
|
|
$navbtns = $navbar.find("a"),
|
|
iconpos = $navbtns.filter('data-icon').length ? this.options.iconpos : undefined;
|
|
|
|
$navbar
|
|
.addClass('ui-navbar')
|
|
.attr("role","navigation")
|
|
.find("ul")
|
|
.grid({grid: $navbtns.length > 2 ? "b" : "a"});
|
|
|
|
if( !iconpos ){
|
|
$navbar.addClass("ui-navbar-noicons");
|
|
}
|
|
|
|
$navbtns
|
|
.buttonMarkup({
|
|
corners: false,
|
|
shadow: false,
|
|
iconpos: iconpos
|
|
});
|
|
|
|
$navbar.delegate("a", "click",function(event){
|
|
$navbtns.removeClass("ui-btn-active");
|
|
});
|
|
}
|
|
});
|
|
})( jQuery ); |