CSS to achieve beautiful text slide folding effect

Source: Internet
Author: User
Tags tagname

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>css to achieve beautiful text slide folding effect |www.balijieji.com</title>
<style type= "Text/css" >
<!--
body,div,ul,li,p,h1,h2{margin:0; padding:0; border:0; background: #FAFAFA; font-family:arial, Helvetica, Sans-serif, " Song Body "}
body{text-align:center; font-size:12px}
li{List-style:none}
. 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}
. content{height:150px;width:400px; background: #fff; background: #FAFAFA}
. Content p{Margin:12px}
-
</style>
<script type= "Text/javascript" >
<! [cdata[
Window.onload = function () {
Rolintab ("Rolin")
}
function Rolintab (obj) {
var list = $ (obj). getElementsByTagName ("LI");
var state = {Show:false,hidden:false,showobj:false};
for (var i=0; i<list.length; i++) {
var tmp = new Rolinitem (list[i],state);
if (i = = 0) tmp.pshow ();
}
}
function Rolinitem (obj,state) {
var speed = 0.0666;
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 ();
}
This.pshow = Show;
var Baseh = content.offsetheight;
Content.style.display = "None";
var isOpen = false;
Head.onmouseover = function () {
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>
<ul class= "rolinlist" id= "Rolin" >
<li>
<div class= "Content" ><p> at that time, the moon in the clouds, <br/><br/>
Tired of the beauty, haggard for thousands of years, how much love late-night language, a little listening to the wind leisurely. <br/>
Village recalled dream back, elegant like smoke, friends don't pity shadow single. <br/>
Now the desert wind Idle, snowy cold, the East China Sea Cloud light, Stone Valley who cherish the edge. <br/>
Tired of heart, ask also bored, all the way to the sand scouring, what day again comfort don't edge! </p></div>
</li>
<li>
<div class= "Content" ><p> Li-Yue yi-Yue, sleeve decoration knives, clothing and cream, the disdain of fog pills, unarmed war hibiscus. <br/>
To seek the Emperor Mausoleum, shadow No, corpse full hillock, but see inverse rohu dew. <br/>
Beard, Qi authoritative, three feet silver wolf, break the Wind movement Happo. <br/>
According to body clenched soul gun, drink tiger blood, Hao. Only thousand years my hometown!</p></div>
</li>
<li>
<div class= "Content" ><p> once had a dream: Gallop the lake, the pleasure of the hatred. <br/>
There was a wish: thousands of miles chasing the fierce, ten steps splashing blood. <br/>
Once there is a cavity passion: expressed, the name of the Crown martial Arts. <br/>
There was a kind of hope: the Candle shadow red, the sleeves add incense. </p></div>
</li>
<li>
<div class= "Content" ><p> Zhao Ke Hu Yu, Wu Hook Frost Snow Ming. The silver Saddle shines the White horse, the sa stacks like a meteor. <br/>
Ten steps to kill a person, thousands of miles do not leave a line. Thing to brush the clothes to go, deep hiding with the name. <br/>
The xinling drink, take off the sword knee front transverse. will be roasted, Zhu Hai, holding cheers advised Hou. <br/>
Three cups spit promise, five mountains pour for light. After Kyanghuarge, he was born with a neon. <br/>
Save Zhao Swing Gold Hammer, Handan first shocked. The two heroes, Sheuan Beam City. <br/>
Die chivalrous incense, not ashamed the world. Who can book Your Excellency, the only too Xuan Jing. </p>
</div>
</li>
<li>
<div class= "content" ><p> palm hand, oblique into the eye, a round of carefree, drunk landscape leisure. <br/>
The desert water, fish swim shallow bottom, the eyes of a day. <br/>
Love in the village friends talk, happy point, laughter repeatedly, spontaneous night without sleep. <br/>
The moon is in the West, the wind is disorderly star cold, turn mellow old thing, moth son dancing lamp front. </p></div>
</li>
<li>
<div class= "Content" >

<p> Paris Guide Www.balidaoyou.cn<br/>
Paris pick-up www.balijieji.com </p>
</div>
</li>
</ul>
</body>

CSS to achieve beautiful text slide folding effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.