Changeset 25992


Ignore:
Timestamp:
Dec 17, 2013, 11:09:53 PM (10 years ago)
Author:
Miklfe
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PwgCarbon_dft/js/menu.js

    r19209 r25992  
    1 /*
    2  * jQuery Mega Drop Down Menu script by Soh Tanaka
    3  * http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/
    4  *
    5  */
    61$(document).ready(function(){
     2        $('.mcol').columnize({ columns: 4});
     3        $.each($('.mcol li'), function() {
     4                var $li = $(this),
     5                        $test=$li.find('a');
     6                if($test.length == 0){
     7                        $li.remove()
     8                }
     9        })
     10       
     11        $('li.liSub:last-child dt').addClass('dd_wrapper');
     12        $('li.liSub:last-child dd').addClass('sub');
     13        $('ul#topnav li .sub').hide();
    714
    8         $("li.liSub:last-child dt").addClass('dd_wrapper');
    9         $("li.liSub:last-child dd").addClass('sub');
     15        function megaHoverOver(){
     16                $(this).find('.sub').stop().slideDown(200);
     17        };
     18       
     19        function megaHoverOut(){
     20         $(this).find('.sub').stop().slideUp(200);
     21        };
     22
     23        var $configSub  = {
     24                                                over    : megaHoverOver,   
     25                                                out             : megaHoverOut     
     26                                                };
     27
     28        $('ul#topnav li').hoverIntent($configSub);
     29        $('ul#topnav .sub ul li:last-child a').css('border', 'none');
     30
     31       
     32        $('.cl_wrapper').hover(function(){
     33                if($(this).next('div').is(':hidden')){
     34                        $(this).addClass('activate').next('div').slideDown(200).attr(':visible');
     35                }
     36        });
     37               
     38        $('.cl_wrapper').click(function(){
     39                if($(this).next('div').is(':visible')){
     40                        $(this).next('div').slideUp(200, function(){
     41                                $(this).hide()
     42                        });
     43                        $(this).removeClass('activate').next('div').attr(':hidden');
     44                }
     45        });
     46       
     47        $('.cc_wrapper').click(function(){
     48                if($(this).next('div').is(':visible')){
     49                        $(this).removeClass('activate').next('div').slideUp(200, function(){
     50                                $(this).hide().attr(':hidden');
     51                        });
     52                } else {
     53                        $(this).next('div').slideDown(200).attr(':visible');
     54                }
     55        });
     56
     57        $('.close').click(function(){
     58                $(this).parent().slideUp(200, function(){
     59                                $(this).hide().attr(':hidden')
     60                        }).prev().removeClass('activate');
     61        });
     62               
     63});
     64       
    1065
    1166
    1267
    13         function megaHoverOver(){
    14                 $(this).find(".sub").stop().fadeTo('slow', 1).show();
    15                        
    16         }
    17        
    18         function megaHoverOut(){
    19          $(this).find(".sub").stop().fadeTo('slow', 0, function() {
    20                   $(this).hide();
    21           });
    22         }
    2368
    2469
    25         var configSub = {
    26                  sensitivity: 2,                // number = sensitivity threshold (must be 1 or higher)   
    27                  interval: 0,                   // number = milliseconds for onMouseOver polling interval   
    28                  over: megaHoverOver,   // function = onMouseOver callback (REQUIRED)   
    29                  timeout: 0,                    // number = milliseconds delay before onMouseOut   
    30                  out: megaHoverOut              // function = onMouseOut callback (REQUIRED)   
    31         };
    32 
    33         $("ul#topnav li .sub").css({'opacity':'0'});
    34         $("ul#topnav li").hoverIntent(configSub);
    35        
    36         var configSwitch = {
    37                  sensitivity: 2,                // number = sensitivity threshold (must be 1 or higher)   
    38                  interval: 0,                   // number = milliseconds for onMouseOver polling interval   
    39                  over: switchBoxOver,   // function = onMouseOver callback (REQUIRED)   
    40                  timeout: 0,                    // number = milliseconds delay before onMouseOut   
    41                  out: switchBoxOut              // function = onMouseOut callback (REQUIRED)   
    42         };
    43 
    44         function switchBoxOver(){
    45                 $(this).find(".switchBox").stop().fadeTo('slow', 1).show();
    46                        
    47         }
    48        
    49         function switchBoxOut(){
    50          $(this).find(".switchBox").stop().fadeTo('slow', 0, function() {
    51                   $(this).hide();
    52           });
    53         }
    54         $("ul.categoryActions li").hoverIntent(configSwitch);
    55 
    56        
    57         // Delete the border for the last li of the submenu
    58         $("ul#topnav .sub ul li:last-child a").css("border", "none");
    59 
    60         /*other menubar script*/
    61         //open form login menu         
    62        
    63 
    64        
    65         $(".cl_wrapper").next("div").hide();
    66 
    67        
    68         $(".cl_wrapper").hover(function(){
    69        
    70                 if($(this).next("div").is(":hidden")){
    71                         $(this).next("div").fadeTo('fast', 1);
    72                         $(this).addClass('activate');
    73                         $(this).next("div").attr(":visible")
    74                 }
    75         });
    76                
    77        
    78         $(".cl_wrapper").click(function(){
    79                 if($(this).next("div").is(":visible")){
    80                 $(this).next("div").fadeTo('slow', 0, function(){$(this).hide()});
    81                 $(this).removeClass('activate');
    82                 $(this).next("div").attr(":hidden")
    83                 }
    84         });
    85 
    86         $(".close").click(function(){
    87                 if($("#loger").is(":visible")){
    88                         $("#loger").fadeTo('fast', 0, function(){$(this).hide()});
    89                         $(".cl_wrapper").removeClass('activate');
    90                         $("#loger").attr(":hidden");
    91                 }
    92         });
    93        
    94         $(".cc_wrapper").click(function(){
    95                 if($(this).next("div").is(":visible")){
    96                         $(this).next("div").fadeTo('slow', 0, function(){$(this).hide()});
    97                         $(this).removeClass('activate');
    98                         $(this).next("div").attr(":hidden")
    99                 }
    100         });
    101        
    102         $(".cc_wrapper").click(function(){
    103                 if($(this).next("div").is(":hidden")){
    104                         $(this).next("div").fadeTo('fast', 1);
    105                         $(this).addClass('activate');
    106                         $(this).next("div").attr(":visible")
    107                 }
    108         });
    109        
    110 
    111        
    112        
    113        
    11470
    11571
    116         // make column menubar_categorie
    117         $('.mcol').makeacolumnlists({cols:4, colWidth:155, equalHeight: true, startN: 1});
    118 });
Note: See TracChangeset for help on using the changeset viewer.