style:新闻
Showing
1 changed file
with
14 additions
and
2 deletions
| ... | @@ -73,7 +73,7 @@ function NewsData() { | ... | @@ -73,7 +73,7 @@ function NewsData() { |
| 73 | for (var i = 0; i < result.data.length; i++) { | 73 | for (var i = 0; i < result.data.length; i++) { |
| 74 | if (i == 6) return; | 74 | if (i == 6) return; |
| 75 | publishTime = CutDate(result.data[i].publishTime); | 75 | publishTime = CutDate(result.data[i].publishTime); |
| 76 | li = '<li><a href="./staticViews/xwxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'; | 76 | li = '<li url="'+result.data[i].cover+'"><a href="./staticViews/xwxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'; |
| 77 | li += '<div class="news_item">'; | 77 | li += '<div class="news_item">'; |
| 78 | if (recentlyDay.indexOf(publishTime) > -1) { | 78 | if (recentlyDay.indexOf(publishTime) > -1) { |
| 79 | li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>'; | 79 | li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>'; |
| ... | @@ -82,10 +82,22 @@ function NewsData() { | ... | @@ -82,10 +82,22 @@ function NewsData() { |
| 82 | li += '<span>' + publishTime + '</span></a></li>'; | 82 | li += '<span>' + publishTime + '</span></a></li>'; |
| 83 | ulNews.append(li); | 83 | ulNews.append(li); |
| 84 | } | 84 | } |
| 85 | 85 | if(result.data[0].cover) { | |
| 86 | $('.news-img img').attr('src',result.data[0].cover); | ||
| 87 | }else { | ||
| 88 | $('.news-img img').attr('src','staticImages/news_demo.jpg'); | ||
| 89 | } | ||
| 86 | } | 90 | } |
| 87 | } | 91 | } |
| 88 | }); | 92 | }); |
| 93 | |||
| 94 | $(document).on("mouseover", "#ulNews li", function (e) { | ||
| 95 | if($(this).attr('url')) { | ||
| 96 | $('.news-img img').attr('src',$(this).attr('url')); | ||
| 97 | }else { | ||
| 98 | $('.news-img img').attr('src','staticImages/news_demo.jpg'); | ||
| 99 | } | ||
| 100 | }) | ||
| 89 | } | 101 | } |
| 90 | 102 | ||
| 91 | //加载公告数据 | 103 | //加载公告数据 | ... | ... |
-
Please register or sign in to post a comment