html+css+jQuery新闻公告间歇滚动特效
发表日期: 2020-07-21 09:35:21 浏览次数:105
台州网站推广【台州官网推广哪个效果好】台州百度竞价推广托管、台州百度优化推广外包、台州全网霸屏推广多少钱、台州网络推广一年大概多少费
台(Tāi)州,是浙江省地级市,长江三角洲中心区27城之一 ,国务院批复确定的浙江沿海的区域性中心城市和现代化港口城市 。截至2018年,全市下辖3个区、3个县、代管3个县级市,总面积10050.43平方千米,常住人口613.90万人,城镇人口386.76万人,城镇化率63.0%,常住外来人口达124万人。
台州地处中国华东地区、浙江中部沿海,东濒东海,北靠绍兴市、宁波市,南邻温州市,西与金华市和丽水市毗邻,依山面海,地势由西向东倾斜,西北山脉连绵;夏季受热带海洋气团控制,炎热多雨,为热带气候特征。冬季受极地大陆气团控制,天气温凉,具亚热带气候特征,境内公路交通以沈海高速公路等构成主要公路网。
台州是江南水乡,水穿城过。历史上台州“河网密布、港汊交纵”,水乡风韵不亚于苏杭,有“走遍苏杭、不如温黄”之说。台州素以佛宗道源享誉海内外,是佛教天台宗和道教南宗的发祥地。天台山以其深邃的文化内涵孕育出了博大精深的“和合文化”。台州是浙江“七山一水两分田”的缩影,是山、海、水和谐的生态福地。
html+css+jQuery新闻公告间歇滚动特效
准备好需要用到的图标。
新建html文档。
书写hmtl代码。
<div class="demo demo1">
<h1>百度经验</h1><br />
<div class="BreakingNewsController easing" id="breakingnews1">
<div class="bn-title"></div>
<ul>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
</ul>
<div class="bn-arrows"><span class="bn-arrows-left"></span><span class="bn-arrows-right"></span></div>
</div>
</div>
<div class="demo demo2">
<div class="BreakingNewsController easing" id="breakingnews2">
<div class="bn-title"></div>
<ul id="abc">
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
<li><a href="#" target="_blank">百度经验百度经验百度经验</a></li>
</ul>
<div class="bn-arrows"><span class="bn-arrows-left"></span><span class="bn-arrows-right"></span></div>
</div>
</div>
书写css代码。
body {color:#FFF;background-color: #38545d;}
.demo { width: 700px; margin: 0 auto;}
.demo1 { margin-top: 100px;}
.demo2 { margin-top: 50px;}
a{color:#FFF}
.BreakingNewsController{width:100%; overflow:hidden; background:#FFF; height:auto; position:relative;}
.BreakingNewsController .bn-title{display:inline-block; float:left; padding:10px 20px; background:#5aa628; color:#FFF;}
.BreakingNewsController ul{padding:0; margin:0; display:block; list-style:none; position:absolute; left:180px; right:50px;}
.BreakingNewsController ul li{list-style:none; padding:10px 20px; display:none;}
.BreakingNewsController ul li a{text-decoration:none; color:#333; display:inline-block; overflow:hidden; padding:0;}
.BreakingNewsController .bn-arrows{display:inline-block; float:right; width:50px; position:absolute; right:0; top:0; bottom:0;}
.BreakingNewsController .bn-arrows span{display:block; width:20px; position:absolute; top:0; bottom:0; cursor:pointer; opacity:0.2;}
.BreakingNewsController .bn-arrows span:hover{opacity:1;}
.BreakingNewsController .bn-arrows-left{ left:0; background:url(../images/bn-arrows.png) left center no-repeat;}
.BreakingNewsController .bn-arrows-right{right:10px; background:url(../images/bn-arrows.png) right center no-repeat;}
.easing a, .easing span{transition:.25s linear; -moz-transition:.25s linear; -webkit-transition:.25s linear;}
书写并添加js代码。
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/breakingnews.js"></script>
<script>
$(function(){
$('#breakingnews1').BreakingNews({
title: '公告'
});
$('#breakingnews2').BreakingNews({
title: '滚动新闻',
titlebgcolor: '#099',
linkhovercolor: '#099',
border: '1px solid #099',
timer: 4000,
effect: 'slide'
});
});
</script>
书写breakingnews.js代码。
(function(jQuery){$.fn.BreakingNews=function(settings){var defaults={background:'#FFF',title:'NEWS',titlecolor:'#FFF',titlebgcolor:'#5aa628',linkcolor:'#333',linkhovercolor:'#5aa628',fonttextsize:16,isbold:false,border:'none',width:'100%',autoplay:true,timer:3000,modulid:'brekingnews',effect:'fade'};var settings=$.extend(defaults,settings);return this.each(function(){settings.modulid="#"+$(this).attr("id");var timername=settings.modulid;var activenewsid=1;if(settings.isbold==true)
fontw='bold';else
fontw='normal';if(settings.effect=='slide')
$(settings.modulid+' ul li').css({'display':'block'});else
$(settings.modulid+' ul li').css({'display':'none'});$(settings.modulid+' .bn-title').html(settings.title);$(settings.modulid).css({'width':settings.width,'background':settings.background,'border':settings.border,'font-size':settings.fonttextsize});$(settings.modulid+' ul').css({'left':$(settings.modulid+' .bn-title').width()+40});$(settings.modulid+' .bn-title').css({'background':settings.titlebgcolor,'color':settings.titlecolor,'font-weight':fontw});$(settings.modulid+' ul li a').css({'color':settings.linkcolor,'font-weight':fontw,'height':parseInt(settings.fonttextsize)+6});$(settings.modulid+' ul li').eq(parseInt(activenewsid-1)).css({'display':'block'});$(settings.modulid+' ul li a').hover(function()
{$(this).css({'color':settings.linkhovercolor});},function()
{$(this).css({'color':settings.linkcolor});});$(settings.modulid+' .bn-arrows span').click(function(e){if($(this).attr('class')=="bn-arrows-left")
BnAutoPlay('prev');else
BnAutoPlay('next');});if(settings.autoplay==true)
{timername=setInterval(function(){BnAutoPlay('next')},settings.timer);$(settings.modulid).hover(function()
{clearInterval(timername);},function()
{timername=setInterval(function(){BnAutoPlay('next')},settings.timer);});}
else
{clearInterval(timername);}
function BnAutoPlay(pos)
{if(pos=="next")
{if($(settings.modulid+' ul li').length>activenewsid)
activenewsid++;else
activenewsid=1;}
else
{if(activenewsid-2==-1)
activenewsid=$(settings.modulid+' ul li').length;else
activenewsid=activenewsid-1;}
if(settings.effect=='fade')
{$(settings.modulid+' ul li').css({'display':'none'});$(settings.modulid+' ul li').eq(parseInt(activenewsid-1)).fadeIn();}
else
{$(settings.modulid+' ul').animate({'marginTop':-($(settings.modulid+' ul li').height()+20)*(activenewsid-1)});}}
$(window).resize(function(e){if($(settings.modulid).width()<360)
{$(settings.modulid+' .bn-title').html(' ');$(settings.modulid+' .bn-title').css({'width':'4px','padding':'10px 0px'});$(settings.modulid+' ul').css({'left':4});}else
{$(settings.modulid+' .bn-title').html(settings.title);$(settings.modulid+' .bn-title').css({'width':'auto','padding':'10px 20px'});$(settings.modulid+' ul').css({'left':$(settings.modulid+' .bn-title').width()+40});}});});};})(jQuery);
代码整体结构。
查看效果。
曾经异常火爆的 AI 芯片行业迎来标志性时刻。7 月 20 日,AI 芯片第一股寒武纪正式在科创板上市,开盘后涨幅一度超 350%,截止收盘仍涨近 230%,股价报 212.40 元,市值则从千亿回落至 850 亿元。
AI芯片第一股寒武纪首日暴涨230%市值逼近千亿,失去华为面临商业化难题
寒武纪自诞生以来就自带诸多光环,与华为的合作更是让其名声大噪,也使其迅速进入商业化征途。但随着华为推出自研 AI 芯片,减少采购,寒武纪业务结构巨变,依靠中科院背景带来的关联交易和政府大单在 2019 年拯救了寒武纪。但目前寒武纪尚未实现盈利,最近三年已累计亏损超 16 亿元。
目前,寒武纪已在终端、云端、边缘端三大场景构建了产品和系统平台,但摆在面前的依然是商业化难题,业务持续性和激烈的市场竞争成为隐忧。“寒武纪”曾是人类历史上的生命大爆发时代,如今在 AI 和芯片双重概念加持下,寒武纪何时迎来它的 “寒武纪”?
台州网站推广【台州官网推广哪个效果好】台州百度竞价推广托管、台州百度优化推广外包、台州全网霸屏推广多少钱、台州网络推广一年大概多少费