[28081] | 1 | /* |
---|
| 2 | * menu - v1.0 - 2013-10-01 |
---|
| 3 | * plugin menu for piwitheme |
---|
| 4 | * http://piwitheme.fr/ |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | (function($) { |
---|
| 9 | |
---|
| 10 | $(document).ready(function(){ |
---|
| 11 | |
---|
| 12 | $('li.liSub dt').addClass('dd_wrapper'); |
---|
| 13 | $('li.liSub dd').addClass('sub'); |
---|
| 14 | |
---|
| 15 | $('.sub ul li').on('click',function(){ |
---|
| 16 | var $href = $(this).find('a').attr('href'); |
---|
| 17 | document.location = $href; |
---|
| 18 | }) |
---|
| 19 | |
---|
| 20 | $('.mcol').columnize({ |
---|
| 21 | columns : 4, |
---|
| 22 | doneFunc : function(){ |
---|
| 23 | $('.sub').hide().css('opacity',1); |
---|
| 24 | } |
---|
| 25 | }); |
---|
| 26 | |
---|
| 27 | function megaHoverOver(){ |
---|
| 28 | $(this).find('.sub').stop().slideDown(200); |
---|
| 29 | $(this).find('canvas').stop().animate({ top:'0'}, 200); |
---|
| 30 | |
---|
| 31 | }; |
---|
| 32 | |
---|
| 33 | function megaHoverOut(){ |
---|
| 34 | $(this).find('.sub').stop().slideUp(200); |
---|
| 35 | $(this).find('canvas').stop().animate({ top:'80'}, 200); |
---|
| 36 | }; |
---|
| 37 | |
---|
| 38 | var $configSub = { |
---|
| 39 | over : megaHoverOver, |
---|
| 40 | out : megaHoverOut |
---|
| 41 | }; |
---|
| 42 | |
---|
| 43 | $('#topnav li').hoverIntent($configSub); |
---|
| 44 | |
---|
| 45 | /* $('.ident').mouseenter(function(){ |
---|
| 46 | if($(this).children('div').is(':hidden')){ |
---|
| 47 | $(this).addClass('activate').children('div').slideDown(200).attr(':visible'); |
---|
| 48 | } |
---|
| 49 | }); |
---|
| 50 | $('.cl_wrapper').click(function(){ |
---|
| 51 | if($(this).next('div').is(':visible')){ |
---|
| 52 | $(this).next('div').slideUp(200, function(){ |
---|
| 53 | $(this).hide() |
---|
| 54 | }); |
---|
| 55 | $(this).next('div').attr(':hidden'); |
---|
| 56 | $(this).parent().removeClass('activate'); |
---|
| 57 | } |
---|
| 58 | }); |
---|
| 59 | $('.close').click(function(){ |
---|
| 60 | $(this).parent().slideUp(200, function(){ |
---|
| 61 | $(this).hide().attr(':hidden') |
---|
| 62 | }); |
---|
| 63 | $('.ident').removeClass('activate'); |
---|
| 64 | });*/ |
---|
| 65 | |
---|
| 66 | $('#qsearchInput').focus(function(){ |
---|
| 67 | if($('#qsearchInput').attr('value') == qsearch_prompt){ |
---|
| 68 | $('#qsearchInput').attr('value', '') |
---|
| 69 | } |
---|
| 70 | }); |
---|
| 71 | $('#qsearchInput').blur(function(){ |
---|
| 72 | if($('#qsearchInput').attr('value') != qsearch_prompt){ |
---|
| 73 | $('#qsearchInput').attr('value', qsearch_prompt) |
---|
| 74 | } |
---|
| 75 | }); |
---|
| 76 | }); |
---|
| 77 | })(jQuery); |
---|