js+css实现翻页
<!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=UTF-8">
<title>无标题文档</title>
</head><body>
<div id="frameContent">
写上你要分页的东西!
</div>
<p>
</p><div id="pages" style="font-size: 12px;"></div>
<script language="javascript">
var obj = document.getElementById("frameContent"); //获取内容层
var pages = document.getElementById("pages"); //获取翻页层
var pgindex=1; //当前页
var lastPage = 1 ; //最后一页
var offsetHeight_ys = parseInt(obj.offsetHeight) ;
window.onload = function() //重写窗体加载的事件
{
//alert("parseInt(obj.scrollHeight)="+parseInt(obj.scrollHeight));
//alert("parseInt(obj.offsetHeight)="+parseInt(obj.offsetHeight));
var allpages = Math.ceil(parseInt(obj.scrollHeight)/parseInt(obj.offsetHeight));//获取页面数量
lastPage = allpages ;
pages.innerHTML = "<b>共"+allpages+"页</b>"; //输出页面数量 
相关文档:
2009-10-20 13:30:21
简写CSS一直被我忘记,没办法就搜了点资料,记录如下:
font
简写:
font:italic small-caps bold 12px/1.5em arial,verdana;
等效于:
font-style:italic;font-variant:small-caps;font-weight:bold;font-size:12px;line-height:1.5em;font-family:arial,verdana;
顺序:font-style | font-var ......
只针对ie6,ie7和firefox的csshack
注意都要写在正常样式的后边,除!important方法在前边
---------------针对样式名------------
如果只让ie6看见用*html .head{color:#000;}
如果只让ie7看见用*+html .head{color:#000;}
如果只让ff看见用:root body .head{color:#000;}
如果只让ff、IE8看见用html>/**/body .he ......
IE8 自动在兼容模式下运行:
加入这么一行 <meta http-equiv="x-ua-compatible" content="ie=7" />
其内容随著指定的页面模式而更改,当要模拟IE7时,指定IE=IE7,也可以指定IE=6来模仿IE6
区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;
......
1.全部的代码均在一个DIV容器(我暂时这样称呼) Head里面,我们来看看Head的写法
#Head{
text-align:center;
}
为什么Head前面有一个"#"号呢?
而有的却是在前面加一个"."比如 ".Head",有时候写css的时候干脆什么也不加,比如 td,body,他们有什么区别,具体怎么用,如果仔细你就会发现在HTML ......
css圆角box(百度知道挖出) 1.css .zhidao_box {
position: relative;
width: 100%;
}
.zhidao_box .rg_1, .zhidao_box .rg_2, .zhidao_box .rg_3 {
height: 1px;
font-size: 0px;
ov ......