Authored by whb

index css js

@@ -1050,28 +1050,34 @@ function actionNav() { @@ -1050,28 +1050,34 @@ function actionNav() {
1050 }); 1050 });
1051 } 1051 }
1052 1052
  1053 +/**
  1054 + * 获取三级导航的tip图标
  1055 + * @return {[type]} [description]
  1056 + */
1053 function actionTipPic() { 1057 function actionTipPic() {
1054 - var $content_code = '' 1058 + var tipscode = {};
  1059 + var $contentcode = '';
1055 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code='; 1060 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
1056 var $img = ''; 1061 var $img = '';
1057 var $title = ''; 1062 var $title = '';
1058 var $link = ''; 1063 var $link = '';
1059 1064
1060 - $(document).on('mouseenter','.sub-nav-item',function(){  
1061 - $content_code = $(this).find('.showdetail').attr('data-code');  
1062 - if($content_code){ 1065 + $(document).on('mouseenter', '.sub-nav-item', function() {
  1066 + $contentcode = $(this).find('.showdetail').attr('data-code');
  1067 + if ($contentcode) {
  1068 + if (!tipscode[$contentcode]) {
  1069 + tipscode[$contentcode] = $contentcode;
1063 $img = $(this).find('.showdetail').find('img'); 1070 $img = $(this).find('.showdetail').find('img');
1064 $title = $(this).find('.showdetail').find('.title'); 1071 $title = $(this).find('.showdetail').find('.title');
1065 $link = $(this).find('.showdetail').find('a'); 1072 $link = $(this).find('.showdetail').find('a');
1066 - $.get(serverApi + $content_code+'&width=337&height=250&client_type=web', function(rsdata) {  
1067 - $img.attr('src',rsdata.data.src);  
1068 - $link.attr('href',rsdata.data.url); 1073 + $.get(serverApi + $contentcode + '&width=337&height=250&client_type=web', function(rsdata) {
  1074 + $img.attr('src', rsdata.data.src);
  1075 + $link.attr('href', rsdata.data.url);
1069 $title.text(rsdata.data.title); 1076 $title.text(rsdata.data.title);
1070 }, 'jsonp'); 1077 }, 'jsonp');
1071 } 1078 }
1072 -  
1073 - })  
1074 - 1079 + }
  1080 + });
1075 } 1081 }
1076 1082
1077 /** 1083 /**
@@ -1678,7 +1684,7 @@ function actionLoginInfo() { @@ -1678,7 +1684,7 @@ function actionLoginInfo() {
1678 */ 1684 */
1679 function init() { 1685 function init() {
1680 actionNav(); //处理导航 1686 actionNav(); //处理导航
1681 - actionTipPic();//鼠标移入后查询 1687 + actionTipPic(); //鼠标移入后查询
1682 actionExeTemplate(); //处理模板 1688 actionExeTemplate(); //处理模板
1683 actionInitCookie(); //初始化cookie 1689 actionInitCookie(); //初始化cookie
1684 actionExeCookieMap(); //格式化cookie 1690 actionExeCookieMap(); //格式化cookie
This diff could not be displayed because it is too large.