[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/nice_menus/ -> nice_menus.js (source)

   1  // $Id: nice_menus.js,v 1.10.2.6 2008/08/04 23:45:51 add1sun Exp $
   2  
   3  // We need to do some browser sniffing to weed out IE 6 only
   4  // because only IE6 needs this hover hack.
   5  if (document.all && !window.opera && (navigator.appVersion.search("MSIE 6.0") != -1) && $.browser.msie) {
   6    function IEHoverPseudo() {
   7        $("ul.nice-menu li.menuparent").hover(function(){
   8            $(this).addClass("over").find("> ul").show().addShim();
   9          },function(){
  10            $(this).removeClass("over").find("> ul").removeShim().hide();
  11          }
  12        );
  13        // Add a hover class to all li for CSS styling. Silly naming is done
  14        // so we don't break CSS compatibility for .over class already in use
  15        // and due to the fact that IE6 doesn't understand multiple selectors.
  16        $("ul.nice-menu li").hover(function(){
  17            $(this).addClass("ie-over");
  18          },function(){
  19            $(this).removeClass("ie-over");
  20          }
  21        );
  22      }
  23  
  24      // This is the jquery method of adding a function
  25      // to the BODY onload event.  (See jquery.com)
  26      $(document).ready(function(){ IEHoverPseudo() });
  27  }
  28  
  29  $.fn.addShim = function() {
  30    return this.each(function(){
  31        if(document.all && $("select").size() > 0) {
  32          var ifShim = document.createElement('iframe');
  33          ifShim.src = "javascript:false";
  34              ifShim.style.width=$(this).width()+1+"px";
  35        ifShim.style.height=$(this).find("> li").size()*23+20+"px";
  36              ifShim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
  37            ifShim.style.zIndex="0";
  38      $(this).prepend(ifShim);
  39        $(this).css("zIndex","99");
  40          }
  41      });
  42  };
  43  
  44  $.fn.removeShim = function() {
  45    return this.each(function(){
  46        if (document.all) $("iframe", this).remove();
  47      });
  48  };


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7