分享
 
 
 

带滑动特性的符合Web标准的全屏广告特效代码

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<!-- 把如下代码加入<body>区域中 -->

<!-- Saved From url=http://www.knowsky.com/js -->

<!-- Web Design bbs url=http://www.knowsky.com/bbs-->

<html>

<head>

<title>网页教学网-特效代码->>下拉菜单的导航条</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<SCRIPT language=JavaScript>

<!--

function MM_goToURL() { //v3.0

var i, args=MM_goToURL.arguments; document.MM_returnValue = false;

for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");

}

function JM_cc(ob){

var obj=MM_findObj(ob); if (obj) {

obj.select();js=obj.createTextRange();js.execCommand("Copy");}

}

function MM_findObj(n, d) { //v4.0

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

if(!x && document.getElementById) x=document.getElementById(n); return x;

}

//-->

</SCRIPT>

<SCRIPT language=JavaScript>

<!--

menuPrefix = 'menu'; // Prefix that all menu layers must start with

// All layers with this prefix will be treated

// as a part of the menu system.

var menuTree, mouseMenu, hideTimer, doHide;

function init() {

ie4 = (document.all)?true:false;

ns4 = (document.layers)?true:false;

document.onmousemove = mouseMove;

if (ns4) { document.captureEvents(Event.MOUSEMOVE); }

}

function expandMenu(menuContainer,subContainer,menuLeft,menuTop) {

// Hide all submenus thats's not below the current level

doHide = false;

if (menuContainer != menuTree) {

if (ie4) {

var menuLayers = document.all.tags("DIV");

for (i=0; i<menuLayers.length; i++) {

if ((menuLayers[i].id.indexOf(menuContainer) != -1) && (menuLayers[i].id != menuContainer)) {

hideObject(menuLayers[i].id);

}

}

}

else if (ns4) {

for (i=0; i<document.layers.length; i++) {

var menuLayer = document.layers[i];

if ((menuLayer.id.indexOf(menuContainer) != -1) && (menuLayer.id != menuContainer)) {

menuLayer.visibility = "hide";

}

}

}

}

// If this is item has a submenu, display it, or it it's a toplevel menu, open it

if (subContainer) {

if ((menuLeft) && (menuTop)) {

positionObject(subContainer,menuLeft,menuTop);

hideAll();

}

else {

if (ie4) {

positionObject(subContainer, document.all[menuContainer].offsetWidth + document.all[menuContainer].style.pixelLeft - 10, mouseY);

}

else {

positionObject(subContainer, document.layers[menuContainer].document.width + document.layers[menuContainer].left + 50, mouseY);

}

}

showObject(subContainer);

menuTree = subContainer;

}

}

function showObject(obj) {

if (ie4) { document.all[obj].style.visibility = "visible"; }

else if (ns4) { document.layers[obj].visibility = "show"; }

}

function hideObject(obj) {

if (ie4) { document.all[obj].style.visibility = "hidden"; }

else if (ns4) { document.layers[obj].visibility = "hide"; }

}

function positionObject(obj,x,y) {

if (ie4) {

var foo = document.all[obj].style;

foo.left = x;

foo.top = y;

}

else if (ns4) {

var foo = document.layers[obj];

foo.left = x;

foo.top = y;

}

}

function hideAll() {

if (ie4) {

var menuLayers = document.all.tags("DIV");

for (i=0; i<menuLayers.length; i++) {

if (menuLayers[i].id.indexOf(menuPrefix) != -1) {

hideObject(menuLayers[i].id);

}

}

}

else if (ns4) {

for (i=0; i<document.layers.length; i++) {

var menuLayer = document.layers[i];

if (menuLayer.id.indexOf(menuPrefix) != -1) {

hideObject(menuLayer.id);

}

}

}

}

function hideMe(hide) {

if (hide) {

if (doHide) { hideAll(); }

}

else {

doHide = true;

hideTimer = window.setTimeout("hideMe(true);", 2000);

}

}

function mouseMove(e) {

if (ie4) { mouseY = window.event.y; }

if (ns4) { mouseY = e.pageY; }

}

function itemHover(obj,src,text,style) {

if (ns4) {

var text = '<nobr><a href="' + src + '" class="' + style + '">' + text + '<\/a><\/nobr>'

obj.document.open();

obj.document.write(text);

obj.document.close();

}

}

onload = init;

//-->

</SCRIPT>

<style type=text/css>

<!--

.menu { position: absolute; left: 0; top: 2;

visibility: hidden; background: #FFFFFF;

width: 100px; margin: 0px 0px; padding: 0px 0px;

border: 1px silver solid;

overflow: visible; ; clip: rect( )}

.menu a:visited { font-family: "Tahoma"; font-size: 11px;

text-decoration: none; font-weight: normal;

color: black; background: #E2E2E2;

width: 108px; padding-left: 8px; ; line-height: 22px; border-color: #FFFFFF #666666 #333333 #999999; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; clip: rect( )}

.menu a:hover { font-family: "Tahoma"; font-size: 11px;

text-decoration: none; font-weight: normal;

color: #FFFFFF; background: #009900;

width: 108px; padding-left: 8px; ; line-height: 22px; clip: rect( )}

.menu .border { border: 1px solid #F4F4F4;

border-bottom: 1px solid #808080;

border-right: 1px solid #808080; }

.menu .text { overflow: hidden;

width: 125px; height: 15px; }

.menu .arrow { overflow: hidden;

width: 15px; height: 12px;

padding-left: 5px; padding-top: 3px; }

.menu .arrow img { width: 6px; height: 7px;

border: 0px; } .menu a { font-family: "Tahoma"; font-size: 11px;

text-decoration: none; font-weight: normal;

color: black; background: #E2E2E2;

width: 108px; padding-left: 8px; ; clip: rect( ); border-color: #FFFFFF #666666 #333333 #999999; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; line-height: 22px} .menu a:link { color: #000000; text-decoration: none}

.a { font-size: 12px; text-decoration: none}

a:link { color: #FFFFFF; text-decoration: none}

a:hover { text-decoration: underline}

a:visited { color: #FFFFFF; text-decoration: none}

-->

</style>

</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">

<table border="0" cellpadding="0" cellspacing="1" bgcolor="#333333" width="778" class="a">

<tr bgcolor="#009830" align="center" valign="bottom">

<td width="10" height="18"> </td>

<td width="74"><a href="#;" onMouseOver="expandMenu(null,'menu1',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第一项</a></td>

<td width="58"><a href="#;" onMouseOver="expandMenu(null,'menu2',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第二项</a></td>

<td width="58"><a href="#;" onMouseOver="expandMenu(null,'menu3',getPos(this,'Left'),getPos(this,'Top')+this.offsetHeight);" class="a" >第三项</a></td>

<!--可以复制上面的做出menu4 menu5 menu6....-->

<td width="40"><a href="#;" class="a" >首页</a></td>

<td width="18" height="18"> </td>

</tr>

</table>

<script language="JavaScript">

function getPos(el,sProp) {

var iPos = 0

while (el!=null) {

iPos+=el["offset" + sProp]

el = el.offsetParent

}

return iPos

}

</script>

<!-- 第一开始 -->

<div id="menu1" class="menu" onMouseOut="hideMe();" style="">

<a href="http://knowsky.com" onMouseOver="expandMenu('menu1');">第一项</a><br>

<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a><br>

<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a><br>

<a href="#;" onMouseOver="expandMenu('menu1');">第一项</a><br>

</div>

<!-- 第二开始 -->

<div id="menu2" class="menu" onMouseOut="hideMe();">

<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a><br>

<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a><br>

<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a><br>

<a href="#;" onMouseOver="expandMenu('menu2');">第二项</a><br>

</div>

<!-- 第三开始 -->

<div id="menu3" class="menu" onMouseOut="hideMe();">

<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a><br>

<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a><br>

<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a><br>

<a href="#;" onMouseOver="expandMenu('menu3');">第三项</a><br>

</div>

<!--可以复制上面的做出menu4 menu5 menu6....-->

<p class="a"> </p>

</body>

</html>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有