“html js”目录存档

css设置网页滚动条样式

2010年08月29日,星期日
热度:

严格来说html标准的发展,从html4.01发展到xhtml之后,DOCTYPE声明就起到了很大的作用.

在原来的html的时候,我们可以这样定义整个页面的滚动条
body{
scrollbar-3dlight-color:#D4D0C8; /*- 最外左 -*/
scrollbar-highlight-color:#fff; /*- 左二 -*/
scrollbar-face-color:#E4E4E4; /*- 面子 -*/
scrollbar-arrow-color:#666; /*- 箭头 -*/
scrollbar-shadow-color:#808080; /*- 右二 -*/
scrollbar-darkshadow-color:#D7DCE0; /*- 右一 -*/
scrollbar-base-color:#D7DCE0; /*- 基色 -*/
scrollbar-track-color:#;/*- 滑道 -*/
}

但是同样的代码,我们应用在 xhtml下就不起作用了,我相信好多好朋友也遇到过同样的问题
那么怎么才能在xhtml下应用滚动条样式呢?看下列代码
html{
scrollbar-3dlight-color:#D4D0C8; /*- 最外左 -*/
scrollbar-highlight-color:#fff; /*- 左二 -*/
scrollbar-face-color:#E4E4E4; /*- 面子 -*/
scrollbar-arrow-color:#666; /*- 箭头 -*/
scrollbar-shadow-color:#808080; /*- 右二 -*/
scrollbar-darkshadow-color:#D7DCE0; /*- 右一 -*/
scrollbar-base-color:#D7DCE0; /*- 基色 -*/
scrollbar-track-color:#;/*- 滑道 -*/
}

这段代码和上一段唯一的不同就是在css定义的元素上,一个是body一个是html。我们再测试一下,把html页面的
“body”修改成”html”测试一下,发现依然可以实现效果。那到底是为什么呢?

从字面上来看,xhtml比html多一个x,那么这个x其实也就是xml,为什么要加一个xml在里面?其实最根本的原因就是要让html更加结构化标准化(因为html实在是太烂)。
我们在html里面定义的是body,因为html不是很标准所以这样可以生效,而在xhtml里面这样就不行了,
我看看那个图很明显,body标签本身不是根元素,只有html才是根元素,而页面的滚动条也是属于根元素的,所以这就是我们为什么定义body没有效果 的原因,因为我们定义的只是一个子原素。ok,我们知道了原理,来做一个试验如果把定义”body”或”xhtml”换成”*”,
*{
scrollbar-3dlight-color:#D4D0C8; /*- 最外左 -*/
scrollbar-highlight-color:#fff; /*- 左二 -*/
scrollbar-face-color:#E4E4E4; /*- 面子 -*/
scrollbar-arrow-color:#666; /*- 箭头 -*/
scrollbar-shadow-color:#808080; /*- 右二 -*/
scrollbar-darkshadow-color:#D7DCE0; /*- 右一 -*/
scrollbar-base-color:#D7DCE0; /*- 基色 -*/
scrollbar-track-color:#;/*- 滑道 -*/
}

在html和xhtml都通过,因为*就是定义页面上的任何标签当然也包括了“html”这个标签。

(ps:其实与其说是html与xhtml的区别到不如说是有无XHTML 1.0 transitional doctype的区别,但是如果你把页面的XHTML 1.0 transitional doctype去掉的话,那么这个页面就没有doctype,默认的显示方式就是html4.01,不过你要把XHTML 1.0 transitional doctype修改成HTML 4.01 doctype同样页面定义body也不会有效果的,虽然这个页面的标准是html 4.01)

做网站很有用在线网站集

2010年08月29日,星期日
热度:

好像有些已经是不能用的了.

制作自己个性网站必需的46个工具:应该不错,这些可需要总结收集啊。。。

制作自己个性网站必需的46个工具:哈哈应该不错,这些可需要总结收集啊。。。。
1.itfontMaker——字体制作 http://pentacom.jp/soft/ex/font/edit.html
2.钱币生成器 http://www.onlinewahn.de/generator/m-make
3.图片仓库: http://pic.sdodo.com
3.1.图片缩放裁切工具 http://pic.sdodo.com/tool/picadjust
3.2.大头贴DIY工具 http://pic.sdodo.com/tool/hphoto
3.3.给图片加字工具 http://pic.sdodo.com/tool/addword
3.4.邮箱地址小图标工具 http://pic.sdodo.com/tool/mailpic
3.5.给图片加小标签 http://pic.sdodo.com/tool/piclabel
4.在线FLASH动画制作 http://www.dfilm.com/index_movie_start.html
5.图片生成网页图标 http://www.chami.com/html-kit/services/favicon
6.由蝌蚪网络提供的Gmail注册入口 http://cnc.kedooo.net/gmail
7.最全的邮件/QQ/MSN/BLOG图片生成器 http://www.eoool.com
8.收藏夹图标生成器 http://www.html-kit.com/e/favicon.cgi
9.在线域名LOGO生成 http://phorum.com.tw/Generator.aspx
10.免费3D banner在线制做网站 http://www.3dtextmaker.com/cgi-bin/3dtext.pl
11.输入图片就能查看字体 http://www.myfonts.com/WhatTheFont
12.sitemap网站地图制作工具 http://www.seo.net.cn/sitemap4
13.检测空间商好坏的方法 http://uptime.netcraft.com/up
14.优友网络营销门户:http://www.uusem.com
14.查看该域名IP主机下的其他域名 http://whois.webhosting.info
15.生成email图片 http://www.nhacks.com/email/index.php,
16.世界网络里面有很多不错的测试 http://www.linkwan.com/gb/broadmeter
17.几个大城市的地图搜索 http://map.zhongsou.com
18.图片标签快速生成工具 http://www.eoool.com
19.查询在google所有服务器中的PR值 http://www.iwebtool.com/pagerank_checker?domain=www.chinayoob.com
20.免费加入140个搜索引擎 http://freehosting.hostrave.com/p/ledbetter/submitware/index.php
21.在线生成多种样式的LOGO http://sherlocco.com/create.asp
22.街道路牌签名生成器 http://www.streetsigngenerator.com

http://www.asgone.net/

网页载入和退出的窗口效果

2010年08月29日,星期日
热度:

最近要用网页做课件,用到网页载入和退出效果:

网页载入和退出的效果:

进入页面<meta http-equiv=”Page-Enter” content=”revealTrans(duration=x, transition=y)”>
推出页面<meta http-equiv=”Page-Exit” content=”revealTrans(duration=x, transition=y)”>
这个是页面被载入和调出时的一些特效。duration表示特效的持续时间,以秒为单位。transition表示使
用哪种特效,取值为1-23:
0 矩形缩小
1 矩形扩大
2 圆形缩小
3 圆形扩大
4 下到上刷新
5 上到下刷新
6 左到右刷新
7 右到左刷新
8 竖百叶窗
9 横百叶窗
10 错位横百叶窗
11 错位竖百叶窗
12 点扩散
13 左右到中间刷新
14 中间到左右刷新
15 中间到上下
16 上下到中间
17 右下到左上
18 右上到左下
19 左上到右下
20 左下到右上
21 横条
22 竖条
23 以上22种随机选择一种

让页面中所有链接都在新窗口打开

2010年08月29日,星期日
热度:

今天用到的一个功能,不错。要想页面上所有的链接都在新窗口打开,其实很简单,就只要一段简单的代码就搞定了。
在需要用此功能的页面<head>与 </head>之间加入:

<base target=”_blank”>

注意:< base >必须写在< head >标记

各大搜索引擎的网站提交入口(原创)

2010年08月17日,星期二
热度:

各大搜索引擎的网站提交入口(原创)seo优化必备列表,加快你的网站的收录速度,让自己的网站网上有名!

搜狗网站提交入口, http://www.sogou.com/feedback/urlfeedback.php 支持网站地图sitemap

Google:登录您的网站 http://www.google.com/intl/zh-CN/add_url.html 如果你有谷歌帐号可以用站长工具提交网站地图\

雅虎的提交入口   http://search.help.cn.yahoo.com/h4_4.html

alexa资料提交     http://www.alexa.com/site/help/webmasters

MSN提交URL     http://search.msn.com.cn/docs/submit.aspx

SOHU(搜狐)网站登记-搜狗免费网站登录

http://db.sohu.com/regurl/regform.asp

TOM搜索 >> 网站登录    http://search.tom.com/tools/weblog/log.php

添加到google的blog搜索   http://blogsearch.google.com/ping

改变wordpress的wp_list_categories()返回样式

2010年08月16日,星期一
热度:

wordpress 的wp_list_categories()样式选择

用wp_list_categories()来调用分类的时候,我们没有办法在这里选择元素所使用的独立的css样式,那怎么办呢?举例如下:

<?php echo preg_replace('@<li([^>]*)><a([^>]*)>(.*?)</a>@i', '<li$1><a$2><span>$3</span></a>', wp_list_categories('echo=0&orderby=name&exlude=181&title_li=&depth=1')); ?>

这里使用了preg_replace函数,在wp_list_categories用echo=0得到结果,交给preg_replace处理,而不是直 接显示出来。

这时我们就可以设置自己的css样式了!

CSS中背景background-position负值定位深入理解(转)

2010年07月26日,星期一
热度:

CSS中背景定位background-position负值一直是不好理解的难点,一方面用的比较少,另一方面的理解的不够深入,今天花了点时间认真的思考了,把我的心得写出来.
下面是我要用到的一个背景图:

代码如下:

<!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” lang=”gb2312″>
<head>

<style type=”text/css” >
<!–
.style1,.style2,.style3{
float:left;
width:162px;
height:162px;
background:#CCCCCC url(/jiaocheng/UploadFiles/200804/2008041122582457.gif) 0 0 no-repeat;
border:1px dotted #999999;
color:red;
margin-right:10px;
}
.style2{
background-position:-50px -50px;
}
.style3{
background-position:100px 100px;
}
.blue{
color:blue;
}
–>
</style>
</head>
<body>
<div>
x:0,<span>y:0</span>
</div>
<div>
x:-50px,<span>y:-50px</span>
</div>
<div>
x:100px,<span>y:100px</span>
</div>
</body>
</body>
</html>
HTML页中是162*162的灰色背景DIV块并加入三种不同位置的背景图片,
在浏览器中看到的效果:

从上图可以看到:当为background-position:0 0;时图片的左上角与DIV的左上角是重合的,当我们定位于background-position:-50px -50px;时发现图片向左、上移动了,也就以DIV的左上角为中心,图向左移动了50PX,向上也移动了50PX.第三个示例采用的都是正值,可以解解释为图向右、向下移动的效果.这个应该是好理解的.
总结一下就是以上都是以DIV的0,0点为参考点图片移动,如果把DIV区解释为一个坐标轴图,向左,上都为负,向右,下为正值.

好象说这么多你也记不住,那我就告诉你,你应该记住什么吧!

在实践中多数情况是知道一个图的位置要如上图中那个黄色的点,我们应该在效果图上量出它的长度得出两个值都是150PX,那我们定义图的位置就要写background-position:-150px -150px;这样就定义好了,在图上的量法就看下图(这张图相当于你用的效果图或称设计图),记住这张图相信你一定能掌握背景图负值的方法了。

到此我们可能就明白了如何用background里的定位值来准确定位一个背景图片,返回去我们看一下开始的时候介绍的两个图片,我们就是可以用:背景定位和容器内才可见这两个性质来随意的调用整张图片的某一部分。

但是我们为了调用方便,在排列这些小图片的时候要讲究一点规则,比如:小图之间的距离通常是调用小图的容器的大小,或者距离更大一点,这样就可以避免在容器内显示出我们不愿意显示的图片!

补充一点,如果定位用的是百分比话,算法比较特殊。我举个例子:

代码:

background:#FFF url(image) no-repeat fixed 50% -30%;

这个时候图片应该在容器的什么位置呢,算法公式如下:

图片左顶点距容器左顶点的坐标位置为
x:(容器的宽度-图片的宽度)x50%
y:(容器的高度-图片的高度)x(-30%)
得到的结果应用坐标法则,差值如果为负数,百分比为正那么运算结果是负值。如果差值为负数,百分比也为负数,那么运算结果就是正数。总而言之就是这里的运算符合运算法则。把运算的结果带入坐标法则就能得到图片的位置。

比如:容器是width:600px;height:600px;而图片是width:200px;height:200px;
我们用上面的样式,可以得到图片位置为:
x:(600px-200px)*50%
y:(600px-200px)*(-30%)
如下图:

html/css教程:背景图片的定位问题详解_中国教程网

以左上角为坐标原点

加入你需要把图片上距左边40PX 距上边10PX的图片显示出来<DIV></div>

.m{ background:url(img/01.jpg) no-repeat;background-position:-40px -10px}

前面的总看得懂吧 解释下这句

background-position:-40px -10px

背景想左偏移40PX 向上偏移10PX

m有多大就显示多大的图片出来

解决PNG图片在IE6中不能透明显示的问题(转)

2010年07月14日,星期三
热度:

最近因为一个客户网站上的图片PNG格式的,需要做成透明的效果,而IE6并不支持PNG的透明效果,所以只好使用CSS HACK或者JS来解决了,在网上搜索了下,下面这段代码正好能解决我的这个问题,现在特地贴出来,供需要这个效果的朋友使用。

/*
*  本文资料由MrMike.cn从网上搜索整理而成.
*  Hofox Technology (2008-2012) www.hofox.net
*  MrMike.CN致力于网站开发,网络推广,企业项目管理等方面的服务.
*/
function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == “PNG”)
{
var imgID = (img.id) ? “id=’” + img.id + “‘ ” : “”
var imgClass = (img.className) ? “class=’” + img.className + “‘ ” : “”
var imgTitle = (img.title) ? “title=’” + img.title + “‘ ” : “title=’” + img.alt + “‘ ”
var imgStyle = “display:inline-block;” + img.style.cssText
if (img.align == “left”) imgStyle = “float:left;” + imgStyle
if (img.align == “right”) imgStyle = “float:right;” + imgStyle
if (img.parentElement.href) imgStyle = “cursor:hand;” + imgStyle
var strNewHTML = “<span ” + imgID + imgClass + imgTitle
+ ” style=\”” + “width:” + img.width + “px; height:” + img.height + “px;” + imgStyle + “;”
+ “filter:progid:DXImageTransform.Microsoft.AlphaImageLoader”
+ “(src=\’” + img.src + “\’, sizingMethod=’scale’);\”></span>”
img.outerHTML = strNewHTML
i = i-1
};
};
};

if(navigator.userAgent.indexOf(”MSIE”)>-1)
{
window.attachEvent(”onload”, correctPNG);
};

将这段代码复制粘贴到你的页面中,你页面上插入的PNG图片就不再有灰色的背景了,此代码在IE6下运行没问题。

虽然IE7+以上的浏览器已经支持PNG的图片,但是IE6在用户中的使用量还是比较大的,作为网站开发人员,我们可以作为一个兴趣爱好来看待这段代码。

经过再次测试,此代码如不做修改,目前仅对页面中所用的PNG图片有效,对CSS里的PNG背景图片无效。

文章原创:MrMike.cn

文章地址:http://www.mrmike.cn/website-development/technology-developmet-tutorials/png-images-ie6-display-transparent/

自动轮换tab选项卡 easy tab华军软件园整理(原创)

2010年07月5日,星期一
热度:

<script language=”javascript”>
/*
EASY TABS 1.2 Produced and Copyright by Koller Juergen
www.kollermedia.at | www.austria-media.at
Need Help? http:/www.kollermedia.at/archive/2007/07/10/easy-tabs-12-now-with-autochange
You can use this Script for private and commercial Projects, but just leave the two credit lines, thank you.
*/
//EASY TABS 1.2 – MENU SETTINGS
//Set the id names of your tablinks (without a number at the end)
var tablink_idname = new Array(“newupdatelink”,”gameupdatelink”,”codeupdatelink”,”softshowlink”,”downranklink”)
//Set the id names of your tabcontentareas (without a number at the end)
var tabcontent_idname = new Array(“newupdatecontent”,”gameupdatecontent”,”codeupdatecontent”,”softshowcontent”,”downrankcontent”)
//Set the number of your tabs in each menu
var tabcount = new Array(“2″,”3″,”3″,”4″,”3″)
//Set the Tabs wich should load at start (In this Example:Menu 1 -> Tab 2 visible on load, Menu 2 -> Tab 5 visible on load)
var loadtabs = new Array(“1″,”1″,”1″,”1″,”1″)
//Set the Number of the Menu which should autochange (if you dont’t want to have a change menu set it to 0)
var autochangemenu = 0;
//the speed in seconds when the tabs should change
var changespeed = 3;
//should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yes
var stoponhover = 0;
//END MENU SETTINGS
/*Swich EasyTabs Functions – no need to edit something here*/
function easytabs(menunr, active) {if (menunr == autochangemenu){currenttab=active;}if ((menunr == autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr == autochangemenu)&&(stoponhover==0))  {counter=0;} menunr = menunr-1;for (i=1; i <= tabcount[menunr]; i++){document.getElementById(tablink_idname[menunr]+i).className=’tab’+i;document.getElementById(tabcontent_idname[menunr]+i).style.display = ‘none’;}document.getElementById(tablink_idname[menunr]+active).className=’tab’+active+’ tabactive’;document.getElementById(tabcontent_idname[menunr]+active).style.display = ‘block’;}var timer; counter=0; var totaltabs=tabcount[autochangemenu-1];var currenttab=loadtabs[autochangemenu-1];function start_autochange(){counter=counter+1;timer=setTimeout(“start_autochange()”,1000);if (counter == changespeed+1) {currenttab++;if (currenttab>totaltabs) {currenttab=1}easytabs(autochangemenu,currenttab);restart_autochange();}}function restart_autochange(){clearTimeout(timer);counter=0;start_autochange();}function stop_autochange(){clearTimeout(timer);counter=0;}
window.onload=function(){
var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]);  a++; b++;}while (b<=menucount);
if (autochangemenu!=0){start_autochange();}
}
</script>
<style type=”text/css”>
@charset “utf-8″;
/* CSS Document */
/* 游戏 手机 驱动 */
body, div, layer, td, textarea, button {
color: #555;
font-family: 宋体, tahoma;
font-size: 12px;
}
* {
margin: 0px;
padding: 0px;
}
.gameupdate { float: left; width: 258px; height: 151px; border: solid 1px #ecc884; background: #fff; }
.gameupdate ul { float: left; width: 258px; overflow: hidden; }
.gameupdate .menu li { float: left; }
.gameupdate .menu a { float: left; background: #fffcdb; border-right: solid 1px #ecc884; border-bottom: solid 1px #ecc884; width: 85px; height: 24px; text-align: center; display: block; line-height: 24px; color: #000; }
.gameupdate .menu a.tab3 { width: 86px; border-right: none; }
.gameupdate .menu a.tabactive { background: #fff; border-bottom: none; color: #000; font-weight: bold; text-decoration: none; }
.gameupdate .menu a.special { width: 86px; border-right: none; }
.gameupdate .gameupdate-list { float: left; width: 240px; }
.gameupdate .gameupdate-list div { float: left; width: 240px; padding-left: 9px; padding-top: 9px; }
.gameupdate .gameupdate-list ul { float: left; width: 240px; padding: 0; margin: 0; overflow: hidden; }
.gameupdate .gameupdate-list li { text-indent: 1em; background: url(../images/common/ico_4.gif) no-repeat 3px 6px; width: 240px; line-height: 18px; overflow: hidden; }
</style>
<div>
<div>
<ul>
<li><a href=”#” onmouseover=”easytabs(’3′, ’1′);” onfocus=”easytabs(’3′, ’1′);” onclick=”return false;” title=”" id=”codeupdatelink1″>源码</a></li>
<li><a href=”#” onmouseover=”easytabs(’3′, ’2′);” onfocus=”easytabs(’3′, ’2′);” onclick=”return false;” title=”" id=”codeupdatelink2″>linux</a></li>
<li><a href=”#” onmouseover=”easytabs(’3′, ’3′);” onfocus=”easytabs(’3′, ’3′);” onclick=”return false;” title=”" id=”codeupdatelink3″>MAC</a></li>
</ul>
</div>
<div>
<div id=”codeupdatecontent1″ style=”display: block; “><ul><li><a target=”_blank” href=”http://web.newhua.com/soft/3380.htm” title=” 易和阳光购物商城 1.5 “>易和阳光购物商城 1.5</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3530.htm” title=” 网纪互联公文签收系统 政府版20100701 “>网纪互联公文签收系统 政府版20100701</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3531.htm” title=” 网纪互联公文签收系统  司法版20100701 “>网纪互联公文签收系统  司法版20100..</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/2890.htm” title=” JTBC网站内容管理系统 2.0.0.9  ”>JTBC网站内容管理系统 2.0.0.9 </a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3532.htm” title=” 网纪互联公事审批系统 20100701 “>网纪互联公事审批系统 20100701</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/5398.htm” title=” hao123网址导航风格(晓风网址导航系统) 4.2 “>hao123网址导航风格(晓风网址导航系..</a></li></ul></div>
<div id=”codeupdatecontent2″ style=”display: none; “><ul><li><a target=”_blank” href=”http://linux.newhua.com/soft/993.htm” title=” Adobe Reader 9.3.3 “>Adobe Reader 9.3.3</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/451.htm” title=” Berkeley DB 5.0.26 “>Berkeley DB 5.0.26</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/387.htm” title=” Git 1.7.1.1 “>Git 1.7.1.1</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/1654.htm” title=” mkvtoolnix 4.0.0 “>mkvtoolnix 4.0.0</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/1101.htm” title=” Evolution Exchange 2.31.4 “>Evolution Exchange 2.31.4</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/3590.htm” title=” VueScan 8.6.40 “>VueScan 8.6.40</a></li></ul></div>
<div id=”codeupdatecontent3″ style=”display: none; “><ul><li><a target=”_blank” href=”http://mac.newhua.com/soft/263.htm” title=” VueScan 8.6.40 “>VueScan 8.6.40</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/1138.htm” title=” Airfoil 3.5.2 “>Airfoil 3.5.2</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/841.htm” title=” RationalPlan Multi Project 3.17.1 “>RationalPlan Multi Project 3..</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/487.htm” title=” Preference Manager 2.0.9 “>Preference Manager 2.0.9</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/91.htm” title=” RationalPlan Single Project 3.17.1 “>RationalPlan Single Project ..</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/798.htm” title=” TCExam 11.0.005 “>TCExam 11.0.005</a></li></ul></div>
</div>
</div>

<script language=”javascript”>/*EASY TABS 1.2 Produced and Copyright by Koller Juergenwww.kollermedia.at | www.austria-media.atNeed Help? http:/www.kollermedia.at/archive/2007/07/10/easy-tabs-12-now-with-autochangeYou can use this Script for private and commercial Projects, but just leave the two credit lines, thank you.*/
//EASY TABS 1.2 – MENU SETTINGS//Set the id names of your tablinks (without a number at the end)var tablink_idname = new Array(“newupdatelink”,”gameupdatelink”,”codeupdatelink”,”softshowlink”,”downranklink”)//Set the id names of your tabcontentareas (without a number at the end)var tabcontent_idname = new Array(“newupdatecontent”,”gameupdatecontent”,”codeupdatecontent”,”softshowcontent”,”downrankcontent”) //Set the number of your tabs in each menuvar tabcount = new Array(“2″,”3″,”3″,”4″,”3″)//Set the Tabs wich should load at start (In this Example:Menu 1 -> Tab 2 visible on load, Menu 2 -> Tab 5 visible on load)var loadtabs = new Array(“1″,”1″,”1″,”1″,”1″)  //Set the Number of the Menu which should autochange (if you dont’t want to have a change menu set it to 0)var autochangemenu = 0;//the speed in seconds when the tabs should changevar changespeed = 3;//should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yesvar stoponhover = 0;//END MENU SETTINGS

/*Swich EasyTabs Functions – no need to edit something here*/function easytabs(menunr, active) {if (menunr == autochangemenu){currenttab=active;}if ((menunr == autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr == autochangemenu)&&(stoponhover==0))  {counter=0;} menunr = menunr-1;for (i=1; i <= tabcount[menunr]; i++){document.getElementById(tablink_idname[menunr]+i).className=’tab’+i;document.getElementById(tabcontent_idname[menunr]+i).style.display = ‘none’;}document.getElementById(tablink_idname[menunr]+active).className=’tab’+active+’ tabactive’;document.getElementById(tabcontent_idname[menunr]+active).style.display = ‘block’;}var timer; counter=0; var totaltabs=tabcount[autochangemenu-1];var currenttab=loadtabs[autochangemenu-1];function start_autochange(){counter=counter+1;timer=setTimeout(“start_autochange()”,1000);if (counter == changespeed+1) {currenttab++;if (currenttab>totaltabs) {currenttab=1}easytabs(autochangemenu,currenttab);restart_autochange();}}function restart_autochange(){clearTimeout(timer);counter=0;start_autochange();}function stop_autochange(){clearTimeout(timer);counter=0;}
window.onload=function(){var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]);  a++; b++;}while (b<=menucount);if (autochangemenu!=0){start_autochange();}}</script><style type=”text/css”>@charset “utf-8″;
/* CSS Document *//* 游戏 手机 驱动 */body, div, layer, td, textarea, button {color: #555;font-family: 宋体, tahoma;font-size: 12px;}* {margin: 0px;padding: 0px;}.gameupdate { float: left; width: 258px; height: 151px; border: solid 1px #ecc884; background: #fff; }
.gameupdate ul { float: left; width: 258px; overflow: hidden; }
.gameupdate .menu li { float: left; }
.gameupdate .menu a { float: left; background: #fffcdb; border-right: solid 1px #ecc884; border-bottom: solid 1px #ecc884; width: 85px; height: 24px; text-align: center; display: block; line-height: 24px; color: #000; }
.gameupdate .menu a.tab3 { width: 86px; border-right: none; }
.gameupdate .menu a.tabactive { background: #fff; border-bottom: none; color: #000; font-weight: bold; text-decoration: none; }
.gameupdate .menu a.special { width: 86px; border-right: none; }
.gameupdate .gameupdate-list { float: left; width: 240px; }
.gameupdate .gameupdate-list div { float: left; width: 240px; padding-left: 9px; padding-top: 9px; }
.gameupdate .gameupdate-list ul { float: left; width: 240px; padding: 0; margin: 0; overflow: hidden; }
.gameupdate .gameupdate-list li { text-indent: 1em; background: url(../images/common/ico_4.gif) no-repeat 3px 6px; width: 240px; line-height: 18px; overflow: hidden; }

</style>
<div>             <div>                 <ul>                     <li><a href=”#” onmouseover=”easytabs(’3′, ’1′);” onfocus=”easytabs(’3′, ’1′);” onclick=”return false;” title=”" id=”codeupdatelink1″>源码</a></li>                        <li><a href=”#” onmouseover=”easytabs(’3′, ’2′);” onfocus=”easytabs(’3′, ’2′);” onclick=”return false;” title=”" id=”codeupdatelink2″>linux</a></li>                        <li><a href=”#” onmouseover=”easytabs(’3′, ’3′);” onfocus=”easytabs(’3′, ’3′);” onclick=”return false;” title=”" id=”codeupdatelink3″>MAC</a></li>                    </ul>                </div>                <div> <div id=”codeupdatecontent1″ style=”display: block; “><ul><li><a target=”_blank” href=”http://web.newhua.com/soft/3380.htm” title=” 易和阳光购物商城 1.5 “>易和阳光购物商城 1.5</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3530.htm” title=” 网纪互联公文签收系统 政府版20100701 “>网纪互联公文签收系统 政府版20100701</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3531.htm” title=” 网纪互联公文签收系统  司法版20100701 “>网纪互联公文签收系统  司法版20100..</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/2890.htm” title=” JTBC网站内容管理系统 2.0.0.9  ”>JTBC网站内容管理系统 2.0.0.9 </a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/3532.htm” title=” 网纪互联公事审批系统 20100701 “>网纪互联公事审批系统 20100701</a></li><li><a target=”_blank” href=”http://web.newhua.com/soft/5398.htm” title=” hao123网址导航风格(晓风网址导航系统) 4.2 “>hao123网址导航风格(晓风网址导航系..</a></li></ul></div> <div id=”codeupdatecontent2″ style=”display: none; “><ul><li><a target=”_blank” href=”http://linux.newhua.com/soft/993.htm” title=” Adobe Reader 9.3.3 “>Adobe Reader 9.3.3</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/451.htm” title=” Berkeley DB 5.0.26 “>Berkeley DB 5.0.26</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/387.htm” title=” Git 1.7.1.1 “>Git 1.7.1.1</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/1654.htm” title=” mkvtoolnix 4.0.0 “>mkvtoolnix 4.0.0</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/1101.htm” title=” Evolution Exchange 2.31.4 “>Evolution Exchange 2.31.4</a></li><li><a target=”_blank” href=”http://linux.newhua.com/soft/3590.htm” title=” VueScan 8.6.40 “>VueScan 8.6.40</a></li></ul></div> <div id=”codeupdatecontent3″ style=”display: none; “><ul><li><a target=”_blank” href=”http://mac.newhua.com/soft/263.htm” title=” VueScan 8.6.40 “>VueScan 8.6.40</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/1138.htm” title=” Airfoil 3.5.2 “>Airfoil 3.5.2</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/841.htm” title=” RationalPlan Multi Project 3.17.1 “>RationalPlan Multi Project 3..</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/487.htm” title=” Preference Manager 2.0.9 “>Preference Manager 2.0.9</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/91.htm” title=” RationalPlan Single Project 3.17.1 “>RationalPlan Single Project ..</a></li><li><a target=”_blank” href=”http://mac.newhua.com/soft/798.htm” title=” TCExam 11.0.005 “>TCExam 11.0.005</a></li></ul></div>                </div></div>

vb操作html的一些函数

2010年06月19日,星期六
热度:

‘************************************************
‘**
‘**        写HTML文件的类(一些相关的操作)
‘**
‘************************************************
‘// 写HTML文件头
Public Function WriteHtmlHead(ByRef lngFileNum As Long, _
ByVal strTitle As String)
Print #lngFileNum, “<html>”
Print #lngFileNum, “<head>”
Print #lngFileNum, “<meta http-equiv=Content-Type content=text/html; charset=gb2312>”
Print #lngFileNum, “<title>” & strTitle & “</title>”
Call WriteCss(lngFileNum)
Print #lngFileNum, “</head>”
Call WriteSrcipt(lngFileNum)
Print #lngFileNum, “<body>”
Print #lngFileNum, “<p align=’center’><font color=’#1E77D3′>” & strTitle & “</font></p>”
Print #lngFileNum, “<div align=’center’>”
Print #lngFileNum, “<Table border=’0′ width=’90%’>”
Print #lngFileNum, “<tr><td height=’5′></td></tr></table>”
Print #lngFileNum, “<Table class=’tabBody’ border=’0′ cellspacing=’0′ cellpadding=’0′ width=’90%’>”
End Function
‘// 写HTML文件尾
Public Function WriteHtmlEnd(ByRef lngFileNum As Long)
Dim strVersionNumber             As String
strVersionNumber = “v” & App.Major & “.” & App.Minor & “.” & App.Revision
Print #lngFileNum, “</Table>”
Print #lngFileNum, “<Table border=’0′ width=’90%’><tr><td height=’5′></td></tr>”
Print #lngFileNum, “<tr><td align=’right’ class=’fontNone’>生成时间『” & _
Format$(Now(), “YYYY-MM-DD HH:MM:SS”) & “』</td></tr>”
Print #lngFileNum, “</table></div>”
Print #lngFileNum, “<br>BBS:<a href=’http://www.onbno.com’>网络蛀虫小窝</a>”
Print #lngFileNum, “</body>”
Print #lngFileNum, “</html>”
End Function
‘// 写入CSS样式
Private Sub WriteCss(ByRef lngFileNum As Long)
Print #lngFileNum, “<style type=’text/css’>”
Print #lngFileNum, “A:visited{TEXT-DECORATION: none;Color:#3366CC}”
Print #lngFileNum, “A:active{TEXT-DECORATION: none;Color:#3366CC}”
Print #lngFileNum, “A:hover{TEXT-DECORATION: underline;Color:#FF9933}”
Print #lngFileNum, “A:link{text-decoration: none;Color:#3366CC}”
Print #lngFileNum, “body”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-SIZE:                    12px;”
Print #lngFileNum, ” COLOR:                        #666666;”
Print #lngFileNum, ” FONT-FAMILY:                  宋体,Arial,Verdana,Tahoma,Helvetica;”
Print #lngFileNum, ” BACKGROUND-COLOR:             #FFFFFF;”
Print #lngFileNum, ” SCROLLBAR-FACE-COLOR:         #DBDBDB;”
Print #lngFileNum, ” SCROLLBAR-HIGHLIGHT-COLOR:    #DBDBDB;”
Print #lngFileNum, ” SCROLLBAR-SHADOW-COLOR:       #DBDBDB;”
Print #lngFileNum, ” SCROLLBAR-ARROW-COLOR:        #000000;”
Print #lngFileNum, ” SCROLLBAR-TRACK-COLOR:        #EFEFEF;”
Print #lngFileNum, ” SCROLLBAR-3DLIGHT-COLOR:      #FFFFFF;”
Print #lngFileNum, ” SCROLLBAR-DARKSHADOW-COLOR:   #B1B1B1;”
Print #lngFileNum, “}”
Print #lngFileNum, “TD”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-FAMILY:                  宋体,Arial,Verdana,Helvetica,Tahoma;”
Print #lngFileNum, ” FONT-SIZE:                    12px;”
Print #lngFileNum, ” LINE-HEIGHT:                  15px;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tabBody”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-FAMILY:                  Arial,Verdana,宋体,Helvetica,Tahoma;”
Print #lngFileNum, ” FONT-SIZE:                    12px;”
Print #lngFileNum, ” BORDER-LEFT:                  1px solid #EFEFEF;”
Print #lngFileNum, ” BORDER-RIGHT:                 1px solid #EFEFEF;”
Print #lngFileNum, ” BACKGROUND-COLOR:             #FFFFFF;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdOtherTitle”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-WEIGHT:                  bold;”
Print #lngFileNum, ” PADDING-TOP:                  8px;”
Print #lngFileNum, ” PADDING-BOTTOM:               5px;”
Print #lngFileNum, ” BACKGROUND-COLOR:             #B1B1B1;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #F3F3F3;”
Print #lngFileNum, ” COLOR:                        #FFFFFF;”
Print #lngFileNum, ” CURSOR:                       Hand;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdTitle”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-WEIGHT:                  bold;”
Print #lngFileNum, ” PADDING-TOP:                  8px;”
Print #lngFileNum, ” PADDING-BOTTOM:               5px;”
Print #lngFileNum, ” BACKGROUND-COLOR:             #E5E5E5;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #B1B1B1;”
Print #lngFileNum, ” COLOR:                        #1E77D3;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdSmallTitle”
Print #lngFileNum, “{“
Print #lngFileNum, ” BACKGROUND-COLOR:             #F3F3F3;”
Print #lngFileNum, ” PADDING-TOP:                  3px;”
Print #lngFileNum, ” PADDING-BOTTOM:               2px;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #B1B1B1;”
Print #lngFileNum, ” COLOR:                        #336633;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdFields”
Print #lngFileNum, “{“
Print #lngFileNum, ” BACKGROUND-COLOR:             #F3F3F3;”
Print #lngFileNum, ” PADDING-TOP:                  3px;”
Print #lngFileNum, ” PADDING-BOTTOM:               4px;”
Print #lngFileNum, ” COLOR:                        #336633;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdCell”
Print #lngFileNum, “{“
Print #lngFileNum, ” PADDING-TOP:                  3px;”
Print #lngFileNum, ” PADDING-LEFT:                 2px;”
Print #lngFileNum, ” PADDING-BOTTOM:               2px;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #EFEFEF;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdLeftTitle”
Print #lngFileNum, “{“
Print #lngFileNum, ” BACKGROUND-COLOR:             #F3F3F3;”
Print #lngFileNum, ” FONT-WEIGHT:                  bold;”
Print #lngFileNum, ” PADDING-TOP:                  3px;”
Print #lngFileNum, ” PADDING-LEFT:                 3px;”
Print #lngFileNum, ” PADDING-BOTTOM:               2px;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #DBDBDB;”
Print #lngFileNum, ” COLOR:                        #343434;”
Print #lngFileNum, “}”
Print #lngFileNum, “.tdContent”
Print #lngFileNum, “{“
Print #lngFileNum, ” PADDING-TOP:                  3px;”
Print #lngFileNum, ” PADDING-LEFT:                 3px;”
Print #lngFileNum, ” PADDING-BOTTOM:               2px;”
Print #lngFileNum, ” BORDER-BOTTOM:                1px solid #DBDBDB;”
Print #lngFileNum, “}”
Print #lngFileNum, “.fontNone”
Print #lngFileNum, “{“
Print #lngFileNum, ” COLOR:                        #ccc;”
Print #lngFileNum, “}”
Print #lngFileNum, “select”
Print #lngFileNum, “{“
Print #lngFileNum, ” font-family:                  Tahoma,Verdana,宋体;”
Print #lngFileNum, ” font-size:                    12px;”
Print #lngFileNum, ” line-height:                  15px;”
Print #lngFileNum, ” background-color:             #E5E5E5;”
Print #lngFileNum, ” color:                        #1E77D3;”
Print #lngFileNum, ” border:                       1px #C0C0C0 solid;”
Print #lngFileNum, “}”
Print #lngFileNum, “.cmdbutton”
Print #lngFileNum, “{“
Print #lngFileNum, ” FONT-FAMILY:                  Tahoma,宋体,Verdana;”
Print #lngFileNum, ” FONT-SIZE:                    12px;”
Print #lngFileNum, ” BORDER:                       1px #C0C0C0 solid;”
Print #lngFileNum, ” CURSOR:                       Hand;”
Print #lngFileNum, “}”
Print #lngFileNum, “</style>”
End Sub
‘// 写脚本函数
Private Sub WriteSrcipt(ByRef lngFileNum As Long)
Print #lngFileNum, “<SCRIPT Language=’Javascript’>”
Print #lngFileNum, “function selTabsChange(n)”
Print #lngFileNum, “{“
Print #lngFileNum, ”   location=’#’ + n”
Print #lngFileNum, “}”
Print #lngFileNum, “function tdClick(objName)”
Print #lngFileNum, “{“
Print #lngFileNum, ”   objName.style.display=(objName.style.display ==’none’)?”:’none’;”
Print #lngFileNum, “}”
Print #lngFileNum, “</SCRIPT>”
End Sub