国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

jQuery實(shí)現(xiàn)的彈幕效果完整實(shí)例

2019-11-19 15:31:45
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了jQuery實(shí)現(xiàn)的彈幕效果。分享給大家供大家參考,具體如下:

看視頻的時(shí)候老是會(huì)出現(xiàn)一些彈幕,對(duì)于這個(gè)看著很高大上的特效,其實(shí)也不難實(shí)現(xiàn)。

先來(lái)看看運(yùn)行效果:

下面將整個(gè)代碼顯示出來(lái):

<!doctype html><html lang="en"><head><meta charset="UTF-8"><title>m.survivalescaperooms.com彈幕</title><style type="text/css">  html,body{    background:#efefef;    height:100%;  }  .danmu{    width: 100px;    height:30px;    line-height: 28px;    background: green;    border-radius: 5px;    border:1px solid #fff;    color: #fff;    outline: none;  }  div.mask{    position:fixed;    width:100%;    height:100%;    background:rgba(0,0,0,0.8);    opacity:0.5;    top:0px;    left:0px;  }  div.bottom{    width:100%;    height:77px;    background:linear-gradient(#ccc,#4a4a4a);    position:fixed;    bottom:0px;    left:0px;    text-align:center;    line-height:77px;  }  div.bottom input.content{    width:50%;    min-width: 200px;    height:37px;    border:none;    border-radius:10px 0px 0px 10px;    font-size:16px;    padding:0 10px;    outline:none;  }  div.bottom a.send{    background-color:green;    color:#fff;    display:inline-block;    width:100px;    height:38px;    line-height:37px;    text-align:center;    position:relative;    left:-10px;    top:2px;    border-radius:0px 10px 10px 0px;    text-decoration:none;    font-family:'Microsoft Yahei';  }  div.mask a.button{    width:30px;    height:30px;    border-radius:50%;    background-color:green;    color:#fff;    position:fixed;    top:20px;    right:20px;    text-align:center;    line-height:30px;    font-size:20px;    font-family:'Microsoft Yahei';    border:1px solid #fff;    text-decoration:none;    cursor:pointer;  }  div.text{    color:#fff;    position:fixed;    right:0px;    font-size:20px;    white-space: nowrap;  }</style></head><body><button class="danmu">彈幕技術(shù)</button>  <div class="mask">    <a href="#" rel="external nofollow" rel="external nofollow" class="button">X</a>  </div>  <!-- 底部發(fā)言框前端 -->  <div class="bottom">    <input class="content"></input>    <a href="#" rel="external nofollow" rel="external nofollow" class="send">發(fā)表言論</a>  </div>  <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>  <script>   $("a.send").click(function(){  var val=$(".content").val();  var content=$("<div class='text'>"+val+"</div>");  var top=Math.random()*$(document.body).height()+40+"px";  content.css("top",top);  $(".mask").append(content);  content.animate({right:$(document.body).width()+100},8000,function(){  $(this).remove();  })  });  $('.button').click(function(){      $('div.mask').fadeOut(500);    });    $(".danmu").click(function(){     $('div.mask').fadeIn(500);  });</script></body></html>

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery切換特效與技巧總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常見(jiàn)經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》、《jquery選擇器用法總結(jié)》及《jQuery常用插件及用法總結(jié)

希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 金堂县| 正镶白旗| 东阳市| 永春县| 富民县| 大冶市| 邹城市| 永丰县| 邯郸县| 大悟县| 边坝县| 信宜市| 玛曲县| 乡宁县| 蒙阴县| 鹤壁市| 漳州市| 张北县| 商南县| 临澧县| 金堂县| 镇安县| 连南| 蒙阴县| 湘乡市| 时尚| 龙海市| 永德县| 崇信县| 吉林市| 湖州市| 汝州市| 甘孜县| 山阳县| 静宁县| 托克托县| 都兰县| 广饶县| 宕昌县| 平潭县| 永州市|