jquery實(shí)現(xiàn)可關(guān)閉的倒計(jì)時(shí)廣告特效代碼
本文實(shí)例講述了jquery實(shí)現(xiàn)可關(guān)閉的倒計(jì)時(shí)廣告特效代碼。分享給大家供大家參考。具體如下:
這是一款類似播放視頻時(shí)候最開始的倒計(jì)時(shí)廣告,廣告時(shí)間結(jié)束才能看到視頻內(nèi)容,一個(gè)JS小貼片廣告代碼,右上角帶關(guān)閉按鈕,左上角顯示倒計(jì)時(shí)剩余時(shí)間,運(yùn)行jQuery代碼綜合實(shí)現(xiàn),CSS和HTML共同結(jié)合的網(wǎng)頁特效,兼容各主流瀏覽器,本效果是從門戶網(wǎng)站上整理而來。希望大家喜歡。
先來看看運(yùn)行效果截圖:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-close-time-adv-style-codes/
具體代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<title>js貼片倒計(jì)時(shí)代碼</title>
<style>
*{padding:0;margin:0; font-size:12px;}
ol,ul,li{list-style:none}
img{border:none}
.box{ width:564px; height:361px; margin:20px auto; position:relative; display:none;}
.ad_time{ width:554px; height:351px; background:#000; filter:alpha(opacity=50);-moz-opacity:0.5;opacity: 0.5; padding:5px; position:absolute; top:0; left:0; color:#fff;}
.ad_time span{ font-weight:bold; color:#cc0; padding:0 5px;}
.close{ width:49px; height:20px; background:url(images/close.png) no-repeat; position:absolute; top:0; right:0; cursor:pointer;}
.btn{ width:100px; height:30px; background:#eee; border:1px solid #ddd; font:normal 12px/30px '寰蔣闆呴粦'; text-align:center; margin:20px auto; cursor:pointer;}
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js" language="javascript"></script>
<script type="text/javascript" language="javascript">
function lxfEndtime(){
$t=$('#t').html();
if($t!=0){
$('#t').html($t-1);
$i=setTimeout("lxfEndtime()",1000);
}else{
$('.box').hide();
$('.btn').show();
$('#t').html(6);
$('.ad_time').css({'width':'554px','height':'351px'});
clearTimeout($i);
}
};
$(document).ready(function(){
$('.btn').live('click',function(){
$('.box').show();
$(this).hide();
$('.ad_time').animate({width:110,height:18},'slow');
lxfEndtime();
})
$('.close').click(function(){
$('.box').hide();
$('.btn').show();
$('#t').html(6);
$('.ad_time').css({'width':'554px','height':'351px'});
clearTimeout($i);
})
});
</script>
</head>
<body>
<!--代碼開始-->
<div class="box">
<div class="ad"><a href="#" target="_blank"><img src="images/ad.jpg" /></a></div>
<div class="ad_time">時(shí)間還剩<span id="t">50</span>秒</div>
<div class="close"></div>
</div>
<div class="btn">點(diǎn)擊顯示效果</div>
<!--代碼結(jié)束-->
</body>
</html>
希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。
- jQuery倒計(jì)時(shí)代碼(超簡單)
- jquery實(shí)現(xiàn)手機(jī)發(fā)送驗(yàn)證碼的倒計(jì)時(shí)代碼
- jquery簡單倒計(jì)時(shí)實(shí)現(xiàn)方法
- jQuery實(shí)現(xiàn)發(fā)送驗(yàn)證碼并60秒倒計(jì)時(shí)功能
- 利用jQuery實(shí)現(xiàn)漂亮的圓形進(jìn)度條倒計(jì)時(shí)插件
- jquery 倒計(jì)時(shí)效果實(shí)現(xiàn)秒殺思路
- jQuery 點(diǎn)擊獲取驗(yàn)證碼按鈕及倒計(jì)時(shí)功能
- jQuery 實(shí)現(xiàn)倒計(jì)時(shí)天,時(shí),分,秒功能
- jQuery實(shí)現(xiàn)商品活動(dòng)倒計(jì)時(shí)
- JS/jquery實(shí)現(xiàn)一個(gè)網(wǎng)頁內(nèi)同時(shí)調(diào)用多個(gè)倒計(jì)時(shí)的方法
- jQuery實(shí)現(xiàn)倒計(jì)時(shí)功能完整示例
相關(guān)文章
jQuery DateTimePicker 日期和時(shí)間插件示例
jQuery UI很強(qiáng)大,其中的日期選擇插件Datepicker是一個(gè)配置靈活的插件,這篇文章主要介紹了jQuery DateTimePicker 日期和時(shí)間插件示例,有興趣的可以了解一下。2017-01-01
easyui簡介_動(dòng)力節(jié)點(diǎn)Java學(xué)院整理
這篇文章主要介紹了easyui簡介,詳細(xì)的介紹了什么是easyui和easyui的用法,有興趣的可以了解一下2017-07-07
input:checkbox多選框?qū)崿F(xiàn)單選效果跟radio一樣
checkbox是多選,怎么才能讓他變成單選,效果跟radio一樣呢,本菜鳥就自己寫了個(gè)小程序,代碼很簡單2014-06-06
jquery代碼實(shí)現(xiàn)簡單的隨機(jī)圖片瀑布流效果
瀑布流布局最近真的很流行,很多人都跟我一樣想知道是怎么做出來的吧,經(jīng)過網(wǎng)上搜索大量的參考結(jié)合N邊的實(shí)驗(yàn)今天終于被我寫出來了,這里分享給大家,有需要的小伙伴參考下吧。2015-04-04
jQuery使用unlock.js插件實(shí)現(xiàn)滑動(dòng)解鎖
unlock.js插件具有滑動(dòng)解鎖,尺寸、顏色、字體大小等都可以個(gè)性化定制等特點(diǎn),接下來通過本文給大家分享jQuery使用unlock.js插件實(shí)現(xiàn)滑動(dòng)解鎖思路講解,感興趣的朋友一起看看吧2017-04-04
JavaScript揭秘:實(shí)現(xiàn)自動(dòng)化連連看游戲
這篇文章主要介紹了JavaScript揭秘:實(shí)現(xiàn)自動(dòng)化連連看游戲的相關(guān)資料,需要的朋友可以參考下2023-11-11
jQuery實(shí)現(xiàn)信息提示框(帶有圓角框與動(dòng)畫)效果
這篇文章主要介紹了jQuery實(shí)現(xiàn)信息提示框效果,帶有圓角框與動(dòng)畫功能,點(diǎn)擊上面按鈕實(shí)現(xiàn)對(duì)應(yīng)文字的漸變顯示效果,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-08-08

