Team:ZJU-China/Notebook/week1

From 2011.igem.org

(Difference between revisions)
Line 1: Line 1:
 +
<!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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
-
<link href='http://fonts.googleapis.com/css?family=Molengo' rel='stylesheet' type='text/css'>
+
<title>CSS制作滑动折叠的文字效果 网页设计手册 www.websbook.com</title>
-
<link href='http://fonts.googleapis.com/css?family=Hammersmith+One' rel='stylesheet' type='text/css'>
+
</head>
-
<title>无标题文档</title>
+
<style type="text/css">
<style type="text/css">
<!--
<!--
-
#week1 {
+
body,div,ul,li,p,h1,h2{ margin:0; padding:0; border:0; background:#FAFAFA; font-family:Arial, Helvetica, sans-serif,"宋体"}
-
background-color: #e9e9e9;
+
body{ text-align:center; font-size:12px}
-
width:710px;
+
li{ list-style:none}
-
font-family: 'Molengo', sans-serif;
+
.rolinList{ width:402px; height:auto; margin:20px auto 0 auto; text-align:left}
 +
.rolinList li{margin-bottom:1px;border:1px solid #DADADA}
 +
.rolinList li h2{ width:380px; height:40px;  background:#fff; font-size:14px; line-height:40px; padding-left:20px; color:#333; cursor:pointer}
 +
.n_content{ height:150px;width:400px; background:#fff;  background:#FAFAFA}
 +
.n_content p{ margin:12px}
 +
-->
 +
</style>
 +
 
 +
<script type="text/javascript">
 +
//<![CDATA[
 +
window.onload = function() {
 +
rolinTab("rolin")
}
}
-
.subblock {
+
function rolinTab(obj) {
-
background-color: #FFF;
+
var list = $(obj).getElementsByTagName("LI");
-
margin:10px;
+
var state = {show:false,hidden:false,showObj:false};
-
vertical-align: middle;
+
for (var i=0; i<list.length; i++) {
-
width: 680px;
+
var tmp = new rolinItem(list[i],state);
-
-moz-border-radius: 5px;
+
if (i == 0) tmp.pShow();
-
-webkit-border-radius: 5px;
+
-
border-radius: 5px;
+
-
}
+
-
#mondy h3 {
+
-
color: #90b5d5;
+
}
}
-
.subblock hr{
 
-
height:2px;
 
-
margin-left:10px;
 
-
margin-right:10px;
 
}
}
-
p {
+
function rolinItem(obj,state) {
-
margin: 5px;
+
var speed = 0.0666;
-
padding: 5px;
+
var range = 1;
 +
var interval;
 +
var tarH;
 +
var tar = this;
 +
var head = getFirstChild(obj);
 +
var content = getNextChild(head);
 +
var isOpen = false;
 +
this.pHidden = function() {
 +
if (isOpen) hidden();
}
}
-
h3{
+
this.pShow = show;
-
+
var baseH = content.offsetHeight;
-
margin:10px;}
+
content.style.display = "none";
-
-->
+
var isOpen = false;
-
</style>
+
head.onmouseover = function() {
-
</head>
+
this.style.background = "#EFEFEF";
-
 
+
}
 +
head.onmouseout = mouseout;
 +
head.onclick = function() {
 +
this.style.background = "#EFEFEF";
 +
if (!state.show && !state.hidden) {
 +
if (!isOpen) {
 +
head.onmouseout = null;
 +
show();
 +
} else {
 +
hidden();
 +
}
 +
}
 +
}
 +
function mouseout() {
 +
this.style.background = "#FFF"
 +
}
 +
function show() {
 +
head.style.borderBottom = "1px solid #DADADA";
 +
state.show = true;
 +
if (state.openObj && state.openObj != tar ) {
 +
state.openObj.pHidden();
 +
}
 +
content.style.height = "0px";
 +
content.style.display = "block";
 +
content.style.overflow = "hidden";
 +
state.openObj = tar;
 +
tarH = baseH;
 +
interval = setInterval(move,10);
 +
}
 +
function showS() {
 +
isOpen = true;
 +
state.show = false;
 +
}
 +
function hidden() {
 +
state.hidden = true;
 +
tarH = 0;
 +
interval = setInterval(move,10);
 +
}
 +
function hiddenS() {
 +
head.style.borderBottom = "none";
 +
head.onmouseout = mouseout;
 +
head.onmouseout();
 +
content.style.display = "none";
 +
isOpen = false;
 +
state.hidden = false;
 +
}
 +
function move() {
 +
var dist = (tarH - content.style.height.pxToNum())*speed;
 +
if (Math.abs(dist) < 1) dist = dist > 0 ? 1: -1;
 +
content.style.height = (content.style.height.pxToNum() + dist) + "px";
 +
if (Math.abs(content.style.height.pxToNum() - tarH) <= range ) {
 +
clearInterval(interval);
 +
content.style.height = tarH + "px";
 +
if (tarH != 0) {
 +
showS()
 +
} else {
 +
hiddenS();
 +
}
 +
}
 +
}
 +
}
 +
var $ = function($) {return document.getElementById($)};
 +
String.prototype.pxToNum = function() {return Number(this.replace("px",""))}
 +
function getFirstChild(obj) {
 +
var result = obj.firstChild;
 +
while (!result.tagName) {
 +
result = result.nextSibling;
 +
}
 +
return result;
 +
}
 +
function getNextChild(obj) {
 +
var result = obj.nextSibling;
 +
while (!result.tagName) {
 +
result = result.nextSibling;
 +
}
 +
return result;
 +
}
 +
//]]>
 +
</script>
<body>
<body>
-
<div class="iblock" id="week1">
+
<ul class="rolinList" id="rolin">
-
  <div class="subblock" id="mondy"><h3>Monday</h3>
+
<li>
-
      <hr/>
+
<h2>网页设计手册 www.websbook.com</h2>
-
      <p>   We are a young and happy team of 13 scientists and engineers from very diverse backgrounds.Although this is our first
+
<div class="n_content"><p>域名:<br /><br />
-
year working on a wet lab project and biofilm experiments are new to us, we're currently taking great efforts to build
+
网页设计手册论坛http://bbs.websbook.com<br />
-
the whole system for experiments.Our team progress and more info will be frequently updated so that our iGEM
+
网页设计手册团队博客http://blog.websbook.com<br />
-
experience could be shared as much as possible along the way. We truly welcome you to contact us for any
+
网页设计手册首页 <br />
-
cooperation or suggestion.</p></div>
+
我们致力于为中文网站提供动力</p></div>
-
    <div class="subblock" id="mondy"><h3>Tuesday</h3>
+
</li>
-
      <hr/>
+
<li>
-
      <p> We are a young and happy team of 13 scientists and engineers from very diverse backgrounds.Although this is our first
+
<h2>网页设计手册 websbook.com</h2>
-
year working on a wet lab project and biofilm experiments are new to us, we're currently taking great efforts to build
+
<div class="n_content"><p>域名:www.cnidc.com<br />
-
the whole system for experiments.Our team progress and more info will be frequently updated so that our iGEM
+
网页设计师与建站爱好者之家, <br />
-
experience could be shared as much as possible along the way. We truly welcome you to contact us for any
+
网页设计师与建站爱好者之家, <br />
-
cooperation or suggestion.</p></div>
+
网页设计师与建站爱好者之家, <br />
 +
网页设计师与建站爱好者之家</p></div>
 +
</li>
 +
<li>
 +
<h2>网页设计手册 websbook.com </h2>
 +
<div class="n_content"><p>网页设计师与建站爱好者之家,<br />
 +
网页设计师与建站爱好者之家,<br />
 +
网页设计师与建站爱好者之家,<br />
 +
网页设计师与建站爱好者之家 websbook.COM</p></div>
 +
</li>
 +
<li>
 +
<h2>网页设计手册论坛</h2>
 +
<div class="n_content"><p>bbs.websbook.com <br />
 +
网页设计师与建站爱好者之家,<br />
 +
网页设计师与建站爱好者之家、<br />
 +
网页设计师与建站爱好者之家、<br />
 +
网页设计师与建站爱好者之家。</p>
 +
</div>
 +
</li>
 +
<li>
 +
<h2>网页设计手册 www.websbook.com</h2>
 +
<div class="n_content"><p>域名:<br /><br />
 +
网页设计手册论坛http://bbs.websbook.com<br />
 +
网页设计手册首页<br />
 +
网页设计手册首页 <br />
 +
网页设计师与建站爱好者之家</p></div>
 +
</li>
 +
<li>
 +
<h2>网页设计手册论坛</h2>
 +
<div class="n_content"><p>bbs.websbook.com <br />
 +
网页设计师与建站爱好者之家,<br />
 +
网页设计师与建站爱好者之家、<br />
 +
网页设计师与建站爱好者之家、<br />
 +
网页设计师与建站爱好者之家。</p>
</div>
</div>
 +
</li>
 +
</ul>
</body>
</body>
</html>
</html>

Revision as of 06:50, 9 September 2011

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> CSS制作滑动折叠的文字效果 网页设计手册 www.websbook.com

  • 网页设计手册 www.websbook.com

    域名:

    网页设计手册论坛http://bbs.websbook.com
    网页设计手册团队博客http://blog.websbook.com
    网页设计手册首页
    我们致力于为中文网站提供动力

  • 网页设计手册 websbook.com

    域名:www.cnidc.com
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家

  • 网页设计手册 websbook.com

    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家 websbook.COM

  • 网页设计手册论坛

    bbs.websbook.com
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家、
    网页设计师与建站爱好者之家、
    网页设计师与建站爱好者之家。

  • 网页设计手册 www.websbook.com

    域名:

    网页设计手册论坛http://bbs.websbook.com
    网页设计手册首页
    网页设计手册首页
    网页设计师与建站爱好者之家

  • 网页设计手册论坛

    bbs.websbook.com
    网页设计师与建站爱好者之家,
    网页设计师与建站爱好者之家、
    网页设计师与建站爱好者之家、
    网页设计师与建站爱好者之家。