效果體驗:http://hovertree.com/texiao/css3/10/
一般做圖片切換效果,都會使用JS或者jQuery腳本,今天發現,其實只用CSS也可以實現。試試效果吧。
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>純CSS3實現全屏背景切換焦點圖效果 - 何問起</title> <link rel="stylesheet" type="text/css" href="http://hovertree.com/texiao/css3/10/css/style.css" media="all" /> </head> <body> <div class="slider"> <ul class="clearfix"> <li><a href="http://hovertree.com/texiao/css3/10/#bg1">圖片切換1</a></li> <li><a href="http://hovertree.com/texiao/css3/10/#bg2">圖片切換2</a></li> <li><a href="http://hovertree.com/texiao/css3/10/#bg3">圖片切換3</a></li> <li><a href="http://hovertree.com/texiao/css3/10/#bg4">圖片切換4</a></li> <li><a href="http://hovertree.com/texiao/css3/10/#bg5">圖片切換5</a></li> </ul> </div> <div class="hovertreecontent"> <h1>何問起 純CSS3實現全屏背景切換焦點圖效果</h1> <a href="http://hovertree.com/h/bjaf/8c5uhche.htm" target="_blank">原文</a> <a href="http://hovertree.com/" target="_blank">首頁</a> <a href="http://hovertree.com/texiao/" target="_blank">特效</a> </div> <img src="http://hovertree.com/texiao/css3/10/images/bg1.jpg" alt="美圖" class="bg slideLeft" id="bg1" /> <img src="http://hovertree.com/texiao/css3/10/images/bg2.jpg" alt="美圖" class="bg slideBottom" id="bg2" /> <img src="http://hovertree.com/texiao/css3/10/images/bg3.jpg" alt="美圖" class="bg zoomIn" id="bg3" /> <img src="http://hovertree.com/texiao/css3/10/images/bg4.jpg" alt="美圖" class="bg zoomOut" id="bg4" /> <img src="http://hovertree.com/texiao/css3/10/images/bg5.jpg" alt="美圖" class="bg rotate" id="bg5" /> </body> </html>

