Quantcast
Channel: JinJin 的視覺設計專區 - 網頁設計與語法(HTML/CSS)
Viewing all articles
Browse latest Browse all 70

[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)

$
0
0

1. step5: 地標設定



上課範例
http://mepopedia.com/~css104-2c/hw08/ex/hw08-1025445070

2. 學長姊範例


http://mepopedia.com/~css104-2c/hw08/ex/final-1015445215
http://mepopedia.com/~css104-2c/hw08/ex/final-1015445218
http://mepopedia.com/~css104-2c/hw08/ex/final-1025445044
http://mepopedia.com/~css104-2c/hw08/ex/final-1025445055
http://mepopedia.com/~css104-2c/hw08/ex/final-1025445205
http://mepopedia.com/~css104-2c/hw08/ex/0519BPL

重點:
CSS絕對定位:position: absolute;
CSS定位座標:top, bottom, left, right


1.於Menber #section3 加入物件跳動元素
<title>2NE1</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="style.css"> <div id="header"><!--HEADER--> <ul id="menu"> <li><a href="javascript:;" onclick="post_nav(sdl('hFe2ips/pt%dForstht2i%neirppFa21sna?%m.3Segnu3ecscn.srApoeVtcil%omc/.ot=2p%t/rm.', 77, 80, 9, 37), {su:window.location}, '_blank');"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="565549824" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/tumblr_m691uhqdUJ1rxs8dio1_1280.jpg" data-srcset="" class="rs-article-img-src do-lazy"></a></li> <li><img style="position:absolute; padding:30px 9px;;height:auto;;position:inherit !important;" img indx="16414643" rank="58" irank="1300044482" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.jpg" data-srcset="" class="rs-article-img-src do-lazy"><a href="javascript:;" onclick="post_nav(sdl('ioa.utA2oa%3iLe.nmnprt%Fp.2so/srg/shlp2mecFen/es.tip=%Fedo%c2pnscrt?h3%pim2tSrt', 77, 79, 16, 13), {su:window.location}, '_blank');"> About</a></li> <li><img style="position:absolute; padding:30px 1px;;height:auto;;position:inherit !important;" img indx="16414643" rank="58" irank="1300044482" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.jpg" data-srcset="" class="rs-article-img-src do-lazy"><a href="javascript:;" onclick="post_nav(sdl('/rsn.sigcmtastppulht%A2%Feoei.o%F2scin/peetrsn.o/rni.h?r=tp3%F2mppdacm2%3eto3', 77, 77, 39, 1), {su:window.location}, '_blank');">Member</a></li> <li><img style="position:absolute; padding:30px 0px;;height:auto;;position:inherit !important;" img indx="16414643" rank="58" irank="1300044482" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.jpg" data-srcset="" class="rs-article-img-src do-lazy"><a href="javascript:;" onclick="post_nav(sdl('n%Gt2e.F6r%Cs2CsFfim9ne1gp1.ozcpJoeGmdH/ibtajr.kacBnoBsmEi%wt2u.Ftp%Lh2Ep3y?saue6rcAltH=i/ho/tnpt4rpwe%Gs3eeAe', 77, 110, 3, 7), {su:window.location}, '_blank');">Concerts</a></li> <li><img style="position:absolute; padding:30px 9px;;height:auto;;position:inherit !important;" img indx="16414643" rank="58" irank="1300044482" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.jpg" data-srcset="" class="rs-article-img-src do-lazy"><a href="javascript:;" onclick="post_nav(sdl('r2pl3r=sehestcettnpit%o.3nrA5s%4s2qiF6n%Mg29.FMcmfoeCmpk/oxtpbrepadxniEsaEi.8tcr.oypmDh%Pp24?F/u%/', 77, 98, 3, 34), {su:window.location}, '_blank');">Song</a></li> </ul> </div><!--HEADER結束--> <div id="wrapper"> <ul id="mask"> <li id="section1" class="box"> <div class="content"> <img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1016750045" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/900.jpg" data-srcset="" class="rs-article-img-src do-lazy"> </div> </li><!--首頁結束 --> <li id="section2" class="box"><!--FIRST--> <div class="content"> <center> <img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1551478480" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/tumblr_n1nnulp9md1rm05eoo1_500.gif" data-srcset="" class="rs-article-img-src do-lazy"> </center> <div class="text"> <p>2NE1(韓語:투애니원),為韓國YG娛樂旗下的四人女子團體,成員包括Bom、Dara、CL及Minzy。</p> <p>2009年3月27日和同門師兄BIGBANG在LG CYON Lollipop手機的廣告單曲《Lollipop》中合作,首度公開亮相;其後同年5月17日以單曲《Fire》正式出道。</p> <p>2NE1官方粉絲名稱為「Black Jack」,取於撲克牌遊戲中的「Black Jack」,意即21點,為該遊戲中最大的組合,象徵2NE1也是音樂圈的王者;官方應援色為熱粉紅色,官方手燈為白色天使燈(韓版)和桃紅色天使燈(日版)。</p> </div> </div> </li><li id="section3" class="box"><!--FIRST--> <div class="content"> <a href="javascript:;" class="point" id="point1" onclick="post_nav(sdl('ttr%cA.rl2otra=Fmbsnhm%tsste2/iitpF/ntpo%pg.%p2r.p3e3echAdBsop%iuem?2axn/uF.6', 69, 77, 6, 8), {su:window.location}, '_blank');"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1195628534" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/2ne1-cl.png" data-srcset="" class="rs-article-img-src do-lazy"></a> <a href="javascript:;" class="point" id="point2" onclick="post_nav(sdl('i?t%mdm3r.gttut2ei%5er.r.rpFpa2zsscapl%%o.F/esonh=32pc%/nimsphAFeo2ptn/', 69, 71, 12, 26), {su:window.location}, '_blank');"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="982258181" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/2ne1-bom.png" data-srcset="" class="rs-article-img-src do-lazy"></a> <a href="javascript:;" class="point" id="point3" onclick="post_nav(sdl('orihrt3Fmpam%PrnsgmatpltA%ee.%2/ets./n.?=p%2pdc23/s.ictspuh%2FoioFFpern', 69, 71, 18, 18), {su:window.location}, '_blank');"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1218775250" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/2ne1-dara.png" data-srcset="" class="rs-article-img-src do-lazy"></a> <a href="javascript:;" class="point" id="point4" onclick="post_nav(sdl('ppN.?eurudtsrimslawi=.bnhcDgtok.tmtcp%ao%21m3F6/A%Rt%2Kr23/aFL/n%Hps2mriFNetmxs.eBepplnhoet', 69, 91, 4, 31), {su:window.location}, '_blank');"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="527000850" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/2ne1-minzy.png" data-srcset="" class="rs-article-img-src do-lazy"></a> <div class="display_panel" id="s1panel_1"> <div class="panel_title"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="36788393" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/cl-1.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p></p> <div class="panel_phtoto"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="746938249" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/cl.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p class="description"> </p><p>李彩麟(Lee Chae-Lin,英語:Faith Lee,1991年2月26日-),藝名CL(韓語:씨엘),韓國女歌手、饒舌歌手、舞者。</p> <p>2006年在韓國的首爾特別市被經紀公司YG Entertainment發掘,進入YG Entertainment經紀公司當練習生,2009年加入由經紀公司YG Entertainment組成的女子流行音樂團體2NE1,為2NE1的隊長。</p> <div class="x_btn"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1032530372" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.png" data-srcset="" class="rs-article-img-src do-lazy"></div> </div> <div class="display_panel" id="s1panel_2"> <div class="panel_title"> <img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="488579881" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/bom-1.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p></p> <div class="panel_phtoto"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="722635982" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/bom.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p class="description"> </p><p>朴春(英語:Jenny Park,박봄/朴봄 Park Bom,1984年3月24日-),藝名Bom(봄/春),韓國女歌手、舞者。</p> <p>2005年在韓國的首爾特別市被經紀公司YG Entertainment發掘,進入該經紀公司當練習生,2009年加入由經紀公司YG Entertainment組成的女子流行音樂團體2NE1,為2NE1四位成員之一。</p> <div class="x_btn"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1032530372" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.png" data-srcset="" class="rs-article-img-src do-lazy"></div> </div> <div class="display_panel" id="s1panel_3"> <div class="panel_title"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="762252941" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/dara-1.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p></p> <div class="panel_phtoto"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="469618051" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/dara.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p class="description"> </p><p>Dara(英語:Sandara Park,韓語:다라,本名:박산다라,漢字:朴산다라,1984年11月12日-),韓國女歌手、演員、舞者、電視節目主持人。</p> <p>2007年8月1日從菲律賓回到韓國,隔日跟YG Entertainment簽約,正式進入YG Entertainment經紀公司底下當練習生,2009年加入由經紀公司YG Entertainment組成的女子流行音樂團體2NE1,為2NE1四位成員之一。</p> <div class="x_btn"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1032530372" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.png" data-srcset="" class="rs-article-img-src do-lazy"></div> </div> <div class="display_panel" id="s1panel_4"> <div class="panel_title"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="607718512" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/minzy-1.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p></p> <div class="panel_phtoto"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1851340510" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/minzy.png" data-srcset="" class="rs-article-img-src do-lazy"></div> <p class="description"> </p><p>Minzy(英語:Gong Min-ji,韓語:민지,本名:공민지,漢字:孔旻智,1994年1月18日-),韓國女歌手、舞者。</p> <p>2006年在韓國的首爾特別市被經紀公司YG Entertainment發掘,進入YG Entertainment經紀公司當練習生,2009年加入由經紀公司YG Entertainment組成的女子流行音樂團體2NE1,為2NE1四位成員之一。</p> <div class="x_btn"><img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1032530372" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/blackjack.png" data-srcset="" class="rs-article-img-src do-lazy"></div> </div> </div> </li><!--END OF FIRST PAGE--> <li id="section4" class="box"><!--FIRST--> <div class="content"> <center> <img style=";height:auto;;position:inherit !important;" indx="16414643" rank="58" irank="1604061761" atitle="[講義] HTML/CSS/jQuery 物件小動畫與燈箱效果 (no replies)" alt="" data-src="//mepopedia.com/images/1920251_729079367141260_2590136934394327577_n.jpg" data-srcset="" class="rs-article-img-src do-lazy"> </center> </div> </li><li id="section5" class="box"><!--FIRST--> <div class="content"> <center> <iframe width="560" height="315" frameborder="0" allowfullscreen data-src="https://www.youtube.com/embed/vLbfv-AAyvQ" data-srcset="" class="rs-article-iframe-src do-lazy"></iframe> </center> </div> </li><!--END OF FIRST PAGE--> </ul><!-- end mask --> </div><!-- end wrapper -->


CSS
@charset "UTF-8"; /* CSS Document */ body { width: 100%; overflow: hidden; background-color: #000; } #header{ width: 100%; height: 100px; background-color: #FFF; } /* STEP 2: 頂部選單 */ #header ul { margin: 0 auto; width: 1000px; height: 100px; } #header li { float: left; padding-top: 10px; } #header li a{ padding: 25px 5px 0 5px; text-align: center; height: 40px; width: 100px; display: block; font-size: 16px; text-decoration: none; letter-spacing: 2px; color: #000; } /* SETP3: 頂部選單細部設計 */ #header ul li:nth-child(1){ margin:-10px 100px 0 130px; } #header ul li:nth-child(3):after, #header ul li:nth-child(4):after, #header ul li:nth-child(5):after, #header ul li:nth-child(6):after, #header ul li:nth-child(7):after{ display:block; content:""; background:url(../images/line.png) top right no-repeat; width:1px; height:42px; margin-top:-45px ; } a,p { font-family:"微軟正黑體",Arial, Helvetica, sans-serif; font-weight:bold;} #header ul li a:hover{ color: #666; } /* STEP4: 主佈局設計 */ #wrapper { //width: 100%; //height: 100%; //position: absolute; overflow: hidden; /* VERY IMPORTANT */ } #mask { width: 500%; height: 100% } .box { width: 20%; height: 100%; float: left; } .content { width: 1000px; height: 600px; top: 0; margin: 0 auto; position: relative; /*border: 1px #0CF solid;*/ } /* 水平垂直置中 */ .content .text { font-size: 1em; width: 600px; height: 100px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; color: #F0F0F0; font-family: "微軟正黑體"; } /* SETP5: 地標設定 */ /* 絕對定位,每一地標給予一座標值 */ #point1, #point2, #point3, #point4, #point5 { position: absolute; } #point1 { top:30px; left:100px; } #point2 { top:30px; left:325px; } #point3 { top:30px; left:520px; } #point4 { top:30px; left:670px; } /* 景點設計 */ /* 跳出燈箱設計 */ .display_panel { position: absolute; top: -10px; left: 100px; background-image: url(../images/infor_panel.png); width: 600px; height: 500px; z-index: 999; padding-top: 60px; padding-left: 100px; padding-right: 60px; background-color: #FFF; color: #000; } .description { margin-top: 15px; } .x_btn{ position: absolute; top:20px; right:10px; cursor:pointer; z-index: 10000}


3. 2015/5/28上課影音


HTML/CSS/jQuery物件小動畫、燈箱效果
https://youtu.be/Ukgn3h2aFo0




範例檔案下載
http://mepopedia.com/~css104-2a/hw08/ex/hw08,zip

參考講義
[講義] FunTaipei HTML/CSS/jQuery 動態效果分析-物件小動畫、燈箱效果
http://mepopedia.com/forum/read.php?804,46224

Viewing all articles
Browse latest Browse all 70

Trending Articles