DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery特效代碼 >> jquery實現metro效果示例代碼
jquery實現metro效果示例代碼
編輯:JQuery特效代碼     
1.<head>標簽需要依此引用metrojs.css、jquery.js、metro.js,代碼demo如下
. 代碼如下:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="http://www.drewgreenwell.com/content/metrojs.css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="http://www.drewgreenwell.com/scripts/metrojs.js"></script>
</head>

下面貼出完整的代碼:
. 代碼如下:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="http://www.drewgreenwell.com/content/metrojs.css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="http://www.drewgreenwell.com/scripts/metrojs.js"></script>
</head>
<body>
<h1>簡單的metro demo</h1>
<!--首先是一個div作為metro容器,容器內可以擺放多個liveTile(動態磁貼),class="black"表示用哪種風格,有其他的可以選擇,官網現在支持custom了-->
<div class="blue">
<!--下面是第一個liveTile-->
<!--注意class="live-tile"哦,這個是可以隨便改的,但要和下面的js $(".live-tile").liveTile();同步哦-->
<div class="live-tile">
每一個liveTile都應該有兩個div,分別作為兩個畫面
<div><a href="#">我是第一個liveTile</a></div>
<div>
<p>我是第一個liveTile的第二張臉哦.</p>
</div>
</div>
<!--下面是第二個liveTile-->
<!--默認的寬高是150px,可以改的哦-->
<div class="live-tile" style="width:300px; height:300px">
<div>我是第二個liveTile</div>
<div>
<p>下面放張圖片試試</p>
<img src="http://www.baidu.com/img/bdlogo.gif" alt="我是百度哦" />
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$(".live-tile").liveTile();
});
</script>
</body>
</html>

想弄個iframe來顯示效果,但沒辦法弄,而且很晚了,困,就不弄了,有興趣的自己copy下代碼吧
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved