网站设计中几个非常实用的文字特效收集整理
1、漂亮的css分页按钮效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<title>漂亮的css分页按钮效果 www.jsjgz.cn</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
#nav {
list-style: none;
display: inline;
}
#nav li {
display: inline;
margin-right: 5px;
float: left;
height: 20px;
width: 20px;
}
#nav a {
color: #399;
text-decoration: none;
display: block;
font-size: 14px;
font-family: Geneva, Arial, Helvetica, sans-serif;
border: 1px solid #999;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
}
#nav li a:hover {
font-size: 24px;
line-height: 30px;
height: 30px;
width: 30px;
position: absolute;
z-index: 10;
margin: -5px 0 0 -5px;
font-weight: bold;
color: #CC66FF;
border: 1px dotted #666666;
background: #EEE;
}
</style>
</head>
<body>
<ul id="nav">
<li><a href="#">«</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">6</a></li>
<li><a href="#">7</a></li>
<li><a href="#">8</a></li>
<li><a href="#">»</a></li>
</ul>
</body>
</html>
2.用CSS+js制作滑动折叠的文字效果
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用CSS+js制作滑动折叠的文字效果 计算机故障网 www.jsjgz.cn </title>
</head>
<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,"宋体"}
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>
<h2>计算机故障网 www.jsjgz.cn </h2>
<div class="content"><p>域名:http://www.jsjgz.cn<br /><br />
我们致力于为中文网站提供动力</p></div>
</li>
<li>
<h2>主机网 pc120120.com.cn</h2>
<div class="content"><p>域名:www.pc120120.com.cn<br />
主机网是国内首家IDC行业的B2C交易平台, <br />
依托中国站长站七年积累的上百万用户基础, <br />
提供了虚拟主机、服务器、网络带宽、域名、邮局等IDC类商品的信息发布及担保交易服务, <br />
致力于打造最专业的IDC交易平台</p></div>
</li>
<li>
<h2>主机之家 </h2>
<div class="content"><p>主机之家是集虚拟主机评测和IDC导航服务于一体的IDC评测信息平台,<br />
汇集了国内众多知名IDC服务商和各地电信运营商,<br />
以公正客观的数据来指引用户选择合适的IDC产品和服务,<br />
IDC查询、IDC评测就上主机之家 </p></div>
</li>
<li>
<h2>站长之家论坛</h2>
<div class="content"><p>
中文站长最热论坛,<br />
为站长提供一个交流网站建设、<br />
提升网站流量、经营网站模式、<br />
交换网站链接以及利用网站赚钱与创业的网络平台。</p>
</div>
</li>
<li>
<h2>站长之家 www.chinaz.com</h2>
<div class="content"><p>域名:http://www.chinaz.com<br /><br />
站长之家论坛http://bbs.chinaz.com<br />
站长之家团队博客http://blog.chinaz.com<br />
站长之家首页 http://www.chinaz.com<br />
我们致力于为中文网站提供动力</p></div>
</li>
<li>
<h2>站长之家论坛</h2>
<div class="content"><p>bbs.chinaz.com <br />
中文站长最热论坛,<br />
为站长提供一个交流网站建设、<br />
提升网站流量、经营网站模式、<br />
交换网站链接以及利用网站赚钱与创业的网络平台。</p>
</div>
</li>
</ul>
</body>
</html>
第1页:网站设计中几个非常实用的文字特效收集整理(1) 第2页:网站设计中几个非常实用的文字特效收集整理(2)
© CopyRight 2008-2010, WWW.JSJGZ.CN All Rights Reserved
CopyRight 2008-2010 计算机故障网版权所有 闽ICP备09000710号