All Downloads are FREE. Search and download functionalities are using the official Maven repository.

annis.visualizers.iframe.partitur.jquery.jbar.js Maven / Gradle / Ivy

There is a newer version: 4.0.0-beta.4
Show newest version
/*
 * jbar (for jQuery)
 * version: 0.2.0 (07/02/2011)
 * @requires jQuery v1.4 or later
 * http://javan.github.com/jbar/
 * http://github.com/javan/jbar
 *
 * Licensed under the MIT:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright 2010+ Javan Makhmali :: [email protected]
 *
 * Usage:
 *  
 *  jQuery(function(){
 *    jQuery('.jbar').jbar();
 *  });
 *  // Where .jbar is the class belonging to your menus.
 *
 */

(function($) {
  $.fn.jbar = function(settings) {
    var config = {
      cssClass: 'jbar',
      downArrow: '▼',
      upArrow: '▲',
      showSubmenuEvent: 'click',
      fixIEzindex: true
    };
    
    if (settings) {
      $.extend(config, settings);
    }
  
    this.each(function(){
      var menu = $(this);
      menu.addClass(config.cssClass);
      
      // To allow IE specific css
      if ($.browser.msie) {
        menu.addClass('jbar_browser_IE').addClass('jbar_browser_IE'+parseInt($.browser.version));
      }
      
      menu.find('> li').each(function(){
        var li = $(this);
        var submenu = li.find('ul');
        var link = li.find('> a');
        var hasSubmenu = (submenu.length != 0);
        var hasLink = (link.length != 0);
        var hasAnchorLink = (hasLink && link.attr('href').charAt(0) == '#');
        
        if (hasLink) {
          link.wrapInner('');
          
          if (!hasSubmenu) {
            link.addClass('has_no_down_arrow');
          }
        }
        
        if (!hasSubmenu) {
          return true;
        }
        
        submenu.wrap('




© 2015 - 2024 Weber Informatics LLC | Privacy Policy