/[drupal]/contributions/modules/simplemenu/simplemenu.js
ViewVC logotype

Contents of /contributions/modules/simplemenu/simplemenu.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download) (as text)
Fri Dec 12 06:24:18 2008 UTC (11 months, 2 weeks ago) by rz
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.9: +48 -17 lines
File MIME type: text/javascript
merging DRUPAL-6--1 into HEAD
1 // $Id: simplemenu.js,v 1.9.2.12.2.3 2008/12/06 18:04:45 rz Exp $
2
3 $(document).ready(function() {
4 // If detect pop-ups setting is enabled and we are in a pop-up window
5 if (Drupal.settings.simplemenu.detectPopup && window.opener) {
6 return;
7 }
8
9 // get the element to add the menu to
10 var element = Drupal.settings.simplemenu.element;
11 var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block');
12
13 switch (Drupal.settings.simplemenu.placement) {
14 case 'prepend':
15 $(menu).prependTo(element);
16 break;
17 case 'append':
18 $(menu).appendTo(element);
19 break;
20 case 'replace':
21 $(element).html(menu);
22 break;
23 }
24
25 $('body').addClass('simplemenu-enabled');
26
27 var animation = {};
28 animation[Drupal.settings.simplemenu.effect] = 'toggle';
29
30 // Build menu
31 $(menu)
32 .superfish( {
33 animation: animation,
34 delay: Drupal.settings.simplemenu.hideDelay,
35 speed: Drupal.settings.simplemenu.effectSpeed
36 } )
37 .find(">li:has(ul)")
38 .mouseover(function(){
39 $("ul", this).bgIframe({opacity:false});
40 })
41 .find("a")
42 .focus(function(){
43 $("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false});
44 })
45 .end()
46 .end()
47 .find("a")
48 .removeAttr('title');
49
50 $('#simplemenu').children('li.expanded').addClass('root');
51 });
52
53
54 /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
55 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
56 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
57 *
58 * $LastChangedDate: 2007-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $
59 * $Rev: 2447 $
60 *
61 * Version 2.1.1
62 */
63 (function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);

  ViewVC Help
Powered by ViewVC 1.1.2