// 右侧菜单鼠标进入事件 function floatingmenuover(){ var side_floating_menu = $("#cus_ser");; side_floating_menu.stop(); side_floating_menu.animate({right: "-32px"}, 300, 'swing'); if($(window).width()<769){ var t=setinterval(function time(){ side_floating_menu.stop(); side_floating_menu.animate({right: "-102px"}, "slow", 'swing'); clearinterval(t) side_floating_menu=null; },3000) } } // 右侧菜单鼠标离开事件 function floatingmenuout(){ var side_floating_menu = $("#cus_ser");; side_floating_menu.stop(); side_floating_menu.animate({right: "-102px"}, 300, 'swing'); side_floating_menu=null; } function initsidefloatingmenu(on){ var side_floating_menu = $("#cus_ser"); var side_floating_menus=$(".cus_ser_>.title") console.log('ccccc',on) if(on===true){ side_floating_menu.find('.close').on('click',function () { side_floating_menu.css({display: 'none'}); }) side_floating_menus.on('mouseenter',floatingmenuover) side_floating_menu.on('mouseleave',floatingmenuout) side_floating_menus.on('click',floatingmenuover) }else{ side_floating_menu.off() side_floating_menu.css('right','-34px') } } function spreadthesidefloatingmenu(width) { var side_floating_menu = $("#cus_ser"); if(width==null || width==undefined){ width=1 } side_floating_menu.css({width: width}) } function initsidebarclicker(clicker_tag, show_icon, close_icon,isopen, parent_tag) {//新增isopen参数用于控制是否默认展开左侧菜单,默认为false if (parent_tag === undefined || parent_tag === null) { parent_tag = 'sidebar-product' } if (show_icon === undefined || show_icon === null) { show_icon = '' } if (close_icon === undefined || close_icon === null) { close_icon = '' } if (isopen === undefined || isopen === null) { isopen = false } var parent_obj = $('.' + parent_tag) // parent_obj.find('dd').hide() isopen?'':parent_obj.find('dd').hide(); // isopen?close_icon: $.each(parent_obj.find('dl'), function (k, v) { if ($(v).find('dd').length > 0 && show_icon !== '') { var open_con=isopen?close_icon:show_icon var show_clicker = '<' + clicker_tag + '>' + open_con + '' console.log("xxxxx",show_clicker) $(v).prepend(show_clicker) } }) var top_catalog_id = $('meta[name=t_catalog]').attr('content'); if (top_catalog_id !== null || top_catalog_id !== undefined) { parent_obj.find('.c' + top_catalog_id).find('dd').slidedown(300) parent_obj.find('.c' + top_catalog_id).addclass('clicker_active') parent_obj.find('.c' + top_catalog_id).find('dt').html(close_icon) } parent_obj.find(clicker_tag).click(function () {//点击展开事件 var thisdd = $(this).parent().find('dd') if (thisdd.is(':visible')) { thisdd.slideup(300) $(this).removeclass('clicker_active') if (show_icon !== '') { $(this).html(show_icon) } } else { var otherdd = parent_obj.find('dd:visible') var otherdt = parent_obj.find(clicker_tag + '.clicker_active') otherdd.slideup(300, function () { otherdt.removeclass('clicker_active') if (show_icon !== '') { otherdt.html(show_icon) } }) thisdd.slidedown(300) $(this).addclass('clicker_active') if (close_icon !== '') { $(this).html(close_icon) } } }) } function initsidebarclickerwithoutlink(clicker_tag, expand_label,show_icon, close_icon, parent_tag) { if (parent_tag === undefined || parent_tag === null) { parent_tag = 'sidebar-product' } if (show_icon === undefined || show_icon === null) { show_icon = '' } if (close_icon === undefined || close_icon === null) { close_icon = '' } var parent_obj = $('.' + parent_tag) parent_obj.find('dd').hide(); $.each(parent_obj.find('dl'), function (k, v) { if ($(v).find('dd').length > 0 && show_icon !== '') { var show_clicker = '<' + expand_label + '>' + show_icon + '' $(v).prepend(show_clicker) } }) var top_catalog_id = $('meta[name=t_catalog]').attr('content'); if (top_catalog_id !== null || top_catalog_id !== undefined) { parent_obj.find('.c' + top_catalog_id).find('dd').slidedown(300) parent_obj.find('.c' + top_catalog_id).addclass('clicker_active') parent_obj.find('.c' + top_catalog_id).find('dt').html(close_icon) } parent_obj.find(clicker_tag).click(function () { var thisdd = $(this).parents('dl').find('dd') if (thisdd.is(':visible')) { thisdd.slideup(300) $(this).parents('dl').find(expand_label).removeclass('clicker_active') if (show_icon !== '') { $(this).parents('dl').find(expand_label).html(show_icon) } } else { var otherdd = parent_obj.find('dd:visible') var otherdt = parent_obj.find(expand_label + '.clicker_active') otherdd.slideup(300, function () { otherdt.removeclass('clicker_active') if (show_icon !== '') { otherdt.html(show_icon) } }) thisdd.slidedown(300) $(this).parents('dl').find(expand_label).addclass('clicker_active') if (close_icon !== '') { $(this).parents('dl').find(expand_label).html(close_icon) } } }) }