本文介紹的是利用DW制作九宮格全屏亮燈輪播圖片并且可以自動切換圖片,而且點擊圖片時還會亮燈,推薦過來,大家一起來學習吧!
方法/步驟
1、打開Adobe Dreamweaver,新建一個網(wǎng)頁。然后在</head>以上改為以下代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery圖片九宮格樣式布局圖片切換</title>
<meta name="description" content="jquery圖片九宮格樣式布局通過鼠標滑過縮略圖進行大小圖片切換展示。" />
</head>
2、然后在<body></body>之間插入一下代碼:
<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
body{font:12px/180% Arial, Helvetica, sans-serif ,"新宋體";}
/* image_show */
.image_show{width:948px;padding:3px 0 0 3px;border:1px solid #d9d9d9;margin:30px auto}
.image_show .img{padding:0 3px 3px 0;position:relative;}
.image_show .img, .image_show .img img{float:left;}
.col_left{width:191px;float:left;overflow:hidden;}
.col_right{float:left;width:450px;overflow:hidden;}
#bigImg{position:relative;width:304px;height:382px;}
#bigImg .img_mask{position:absolute;left:0;top:340px;width:304px;height:42px;background:#000;opacity:0.6;filter:alpha(opacity=60);}
#bigImg p{position:absolute;left:0;top:340px;width:304px;height:42px;line-height:42px;font-size:16px;text-align:center;color:#fff;}
#bigImg p a, #bigImg p a:visited{color:#fff;}
.mask{position:absolute;left:0;top:0;background:#000;opacity:0.4;filter:alpha(opacity=40);}
.clear{height:0;clear:both;line-height:0;font-size:0;overflow:hidden;}
</style>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#smallImg img').mouseover(function(){
$('#bigImg img').attr('src',$(this).attr('rel'));
$('#bigImg p > a').text($(this).attr('alt'));
$('#bigImg a').attr('href',$(this).parent().attr('href'));
});
$('#smallImg .img').hover(function(){
$('.mask').fadeIn();
$(this).children('.mask').hide();
},function(){
$('.mask').fadeIn();
});
});
</script>
<div class="image_show">
<div class="img" id="bigImg">
<a href="http://www.shuiqianduwu.com"><img _fcksavedurl=""http://www.shuiqianduwu.com"><img" height="382" width="304" src="/uploads/allimg/170130/2232434J9-1.jpg" />
3、如果,您需要修改輪播的時候文的介紹,則需要在代碼中相應的文字修改掉就可以了。鏈接也是同樣的方法。
4、如果您想換一張圖片,則需要切換到“設計”的頁面,點擊一張圖片,然后點擊“替換”這兩個字前面的文件夾圖標,就可以換圖片了。同樣的,在“鏈接”這兩個字的方框里是這張圖片的鏈接地址,修改的時候在方框里修改就可以了!
5、如果你要修改文字的鏈接,則在下欄切換到“HTML”模式,點擊鏈接修改成您的鏈接。就可以把輪播圖片的蚊子介紹鏈接改掉,其它的也是如此!
以上就是DW制作九宮格全屏亮燈輪播圖片且自動切換圖片教程,操作很簡單的,大家學會了嗎?操作很簡單的,大家按照上面步驟進行即可!
新聞熱點
疑難解答