jQuery(document).ready(function( $ ){ if ( $(window).width() < 769 ) { $('.cust-head-cat').each(function(index, element){ var view_cat_item_mobile = $(this).find(".inner-content-cat-list p:nth-of-type(2)").html(); $(this).find('.inner-content-cat').append('
'+view_cat_item_mobile+'
'); }); } $('.inner-content-cat > h3').hide(); $('.cust-head-cat').each(function(index, element){ var title_href = $(this).find(".inner-content-cat-list p:nth-of-type(2) a").attr('href'); var title = $(this).find(".inner-content-cat h3").html(); $(this).find('.inner-content-cat h3').before('

'+title+'

'); }); var boxHeight = $(".kyaking-catagories .cust-head-cat").height(); $(".cust-head-cat").mouseenter(function(){ $(this).css("overflow","hidden"); //$(this).css("height","auto"); var calulated_height = $(this).find(".inner-content-cat").height()+40; if($(this).find(".inner-content-cat").height()>400) { var view_cat_item = $(this).find(".inner-content-cat-list p:nth-of-type(2)").html(); if(view_cat_item!='') { $(this).css("height","440px"); } else { $(this).css("height","380px"); } $(this).find(".inner-content-cat-list").css("overflow","scroll"); $(this).find(".inner-content-cat-list").css("max-height","280px"); var calulated_height = $(this).find(".inner-content-cat-list").height()+40; if(view_cat_item!='') { $(this).find('.inner-content-cat').append('
'+view_cat_item+'
'); } }else{ $(this).css("height",calulated_height+"px"); } var bottom_value = (calulated_height/2)-40; //$(this).css("max-height","600px"); $(this).css("bottom", "-"+bottom_value+"px"); }).mouseleave(function(){ $(this).css("height","280px"); $(this).find(".inner-content-cat").css("height","auto"); $(this).css("bottom", "-82px"); $(this).find(".inner-content-cat-list").css("overflow","hidden"); $(this).find(".inner-content-cat-list").css("max-height",'100%'); $(this).find(".inner-content-cat-list").css("padding-bottom",'0'); $(this).find('.inner-content-cat .view-cat').remove(); }); }); // Your code in here }); -- If you want to link a JavaScript file that resides on another server (similar to ), then please use the "Add HTML Code" page, as this is a HTML code that links a JavaScript file. End of comment */