Mon

02

Mar

2009

180、RADIO导航

180RADIO导航

脚本说明:

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

<SCRIPT>

<!--  Activate Cloaking Device

var new_url="";

function displayUrl()

   { document.forms[0].display.value=new_url; }

 

// Called by Go For It button - loads selected page.

function leapTo()

   {

   if (  (new_url != "")  &&  (new_url != null)  )

      window.location=new_url;

   else

      alert("\nYou must first select a Radio Button.");

   }

//-->

</SCRIPT>

<FORM>

<TABLE BORDER=3 WIDTH=500>

<TD align="center" BGCOLOR=000080>

  <INPUT TYPE="radio" NAME="buttons2" onClick="new_url='http://www.163.com'; displayUrl()">

  <FONT COLOR=00FFFF><B>网易</B></FONT>

<TD align="center" BGCOLOR=FF0000>

  <INPUT TYPE="radio" NAME="buttons2" onClick="new_url='http://www.sina.com.cn'; displayUrl()">

  <FONT COLOR=000000><B>新浪</B></FONT>

<TD align="center" BGCOLOR=C0C0C0>

  <INPUT TYPE="radio" NAME="buttons2" onClick="new_url='http://www.sohu.com'; displayUrl()">

  <FONT COLOR=800000><B>搜狐</B></FONT>

<TD align="center" BGCOLOR=008080>

  <INPUT TYPE="radio" NAME="buttons2" onClick="new_url='http://www.7stk.com/'; displayUrl()">

  <FONT COLOR=FFFF00><B>网页特效代码</B></FONT>

</TABLE>

<BR><BR><BR>

<TABLE BORDER=0 WIDTH=500>

<TD align="center" WIDTH=250><INPUT TYPE="text" SIZE=30 NAME="display">

<TD align="center" WIDTH=250><INPUT TYPE="button" VALUE="去看看" onClick="leapTo()">

</TABLE>

</FORM>

0 Comments

Mon

02

Mar

2009

179、多层导航菜单

179、多层导航菜单

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

var isDOM = false, isNS4 = false;

if (document.all) var isDOM = true, docObj = 'document.all.', styObj = '.style';

else if (document.layers) var isNS4 = true, docObj = 'document.', styObj = '';

// Hide timeout

var popTimer = 0;

var litNow = new Array();

function popOver(menuNum, itemNum) {

clearTimeout(popTimer);

hideAllBut(menuNum);

litNow = getTree(menuNum, itemNum);

changeCol(litNow, true);

targetNum = menu[menuNum][itemNum].target;

if (targetNum > 0) {

targetName = menu[targetNum][0].id;

menuName = menu[menuNum][0].id;

menuRef = eval(docObj + menuName + styObj);

thisX = parseInt(menuRef.left);

thisY = parseInt(menuRef.top);

// Add onto this the position of the trigger item within the menu

itemPath = docObj;

if (isNS4) itemPath += menuName + '.document.';

itemRef = eval(itemPath + menuName + itemNum.toString() + styObj);

thisX += parseInt(itemRef.left);

thisY += parseInt(itemRef.top);

// Add those to the target's offset to set the target's position, show it.

with (eval(docObj + targetName + styObj)) {

left = parseInt(thisX + menu[targetNum][0].x);

top = parseInt(thisY + menu[targetNum][0].y);

visibility = 'visible';

      }

   }

}

function popOut(menuNum, itemNum) {

// Hide menu in 1/2 sec, *UNLESS* another mouseover clears the timeout!

popTimer = setTimeout('hideAllBut(0)', 500);

}

function getTree(menuNum, itemNum) {

// Array index is the menu number. The contents are null (if that menu is not a parent)

// or the item number in that menu that is an ancestor (to light it up).

itemArray = new Array(menu.length);

while(1) {

itemArray[menuNum] = itemNum;

if (menuNum == 0) return itemArray;

itemNum = menu[menuNum][0].parentItem;

menuNum = menu[menuNum][0].parentMenu;

   }

}

// Pass an array and a boolean to specify colour change, true = over colour.

function changeCol(changeArray, isOver) {

for (menuCount = 0; menuCount < changeArray.length; menuCount++) {

if (changeArray[menuCount]) {

thisMenu = menu[menuCount][0].id;

thisItem = thisMenu + changeArray[menuCount].toString();

newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;

if (isDOM) document.all[thisItem].style.backgroundColor = newCol;

if (isNS4) document[thisMenu].document[thisItem].bgColor = newCol;

      }

   }

}

function hideAllBut(menuNum) {

var keepMenus = getTree(menuNum, 1);

for (count = 0; count < menu.length; count++)

if (!keepMenus[count])

eval(docObj + menu[count][0].id + styObj + '.visibility = "hidden"');

changeCol(litNow, false);

}

// *** MENU CONSTRUCTION FUNCTIONS ***

// Variable to end a div or layer based on browser.

var endDL = isDOM ? '</div>' : '</layer>';

function Menu(id, x, y, width, overCol, backCol, borderCol) {

this.id = id;

this.x = x;

this.y = y;

this.width = width;

// Colours of menu and items.

this.overCol = overCol;

this.backCol = backCol;

this.borderCol = borderCol;

// Parent menu and item numbers, indexed later.

this.parentMenu = null;

this.parentItem = null;

}

function Item(text, href, height, target) {

this.text = text;

this.href = href;

this.height = height;

this.target = target;

}

function startDL(id, x, y, width, height, vis, back, border, zIndex, extraProps) {

// Write a div in IE that resembles a layer's settings, or a layer in NS.

if (isDOM) {

str = '<div id="' + id + '" style="position: absolute; left: ' + x + '; top: ' + y +

 '; width: ' + width + '; height: ' + height + '; visibility: ' + vis + '; ';

if (back) str += 'background: ' + back + '; ';

if (border) str += 'padding: 3px; border: 1px solid ' + border + '; ';

if (zIndex) str += 'z-index: ' + zIndex + '; ';

// End style declaration.

str += '" ';

}

if (isNS4) {

str = '<layer id="' + id + '" left="' + x + '" top="' + y + '" width="' + width +

 '" height="' + height + '" visibility="' + vis + '" ';

if (back) str += 'bgcolor="' + back + '" ';

if (border) str += 'style="border: 1px solid ' + border + '" ';

if (zIndex) str += 'z-index="' + zIndex + '" ';

}

return str + extraProps + '>';

}

function mouseProps(currMenu, currItem) {

return 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')"';

}

function writeMenus(customRoot, popInd) {

for (currMenu = 0; currMenu < menu.length; currMenu++) {

showMenu = true;

if ((currMenu == 0) && customRoot) {

document.write(customRoot);

showMenu = false;

}

with (menu[currMenu][0]) {

// Start generating a div with position offset - no dimensions, colours, mouseovers.

// This position is only relevant for root menu anyway as all others are altered later.

menuHTML = startDL(id, x, y, 0, 0, 'hidden', null, null, 100, '');

// Width is less padding (3 left & right) and border (1 left & right).

var back = backCol, bord = borderCol, currWidth = width - 8;

}

// Y-position of next item, increase if you want a menu header.

itemPos = 0;

// Remember, items start from 1 in the array (0 is menu object itself, above).

for (currItem = 1; currItem < menu[currMenu].length; currItem++) {

// Auto-generate ID's in numerical sequence.

trigID = menu[currMenu][0].id + currItem.toString();

// Now, work with properties of individual menu items.

with (menu[currMenu][currItem]) {

// Start a menu item positioned vertically, with mouse events and colours.

menuHTML += startDL(trigID, 0, itemPos, 0, 0, 'inherit', back, bord, 100, mouseProps(currMenu, currItem)) + '<table width="' + currWidth + '" border="0" cellspacing="0" cellpadding="0"><tr>' + '<td align="left"><a class="Item" href="' + href + '">' + text + '</a></td>' + '<td class="Item" align="right">' + (target ? popInd : '') + '</td></tr></table>' + endDL;

if (target > 0) {

// Set target's parents to this and offset it by the current position.

menu[target][0].parentMenu = currMenu;

menu[target][0].parentItem = currItem;

}

// Move next item position down by this item's height.

itemPos += height;

   }

}

// Write this menu to the document.

if (showMenu) document.write(menuHTML + endDL);

litNow[currMenu] = null;

   }

}

//  End -->

</script>

<style>

<!--

.Item { text-decoration: none; color: #FFFFFF; font: 12px Arial, Helvetica }

-->

</style>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var menu = new Array();

// Default colours passed to most menu constructors (just passed to functions, not

// a global variable - makes things easier to change later).

var defOver = '#336699', defBack = '#003366', defBorder = '#000000';

// Default height of menu items - the spacing to the next item, actually.

var defHeight = 22;

// Menu 0 is the special, 'root' menu from which everything else arises.

menu[0] = new Array();

// Pass a few different colours, as an example.

menu[0][0] = new Menu('rootMenu', 0, 0, 80, '#669999', '#006666', defBorder);

// Notice how the targets are all set to nonzero values...

menu[0][1] = new Item('网页特效代码', 'http://www.7stk.com/', defHeight, 1);

menu[0][2] = new Item('Edit', '#', defHeight, 2);

menu[0][3] = new Item('Help', '#', defHeight, 3);

menu[1] = new Array();

// The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.

menu[1][0] = new Menu('fileMenu', 0, 22, 80, defOver, defBack, defBorder);

menu[1][1] = new Item('Open(新浪)', 'http://www.sina.com.cn', defHeight, 0);

menu[1][2] = new Item('Save-无链接', '#', defHeight, 0);

// Non-zero target means this will trigger a popup.

menu[1][3] = new Item('Reopen', '#', defHeight, 4);

menu[1][4] = new Item('Exit', '#', defHeight, 0);

menu[2] = new Array();

menu[2][0] = new Menu('editMenu', 0, 22, 80, defOver, defBack, defBorder);

menu[2][1] = new Item('Cut', '#', defHeight, 0);

menu[2][2] = new Item('Copy', 'http://www.sina.com.cn', defHeight, 0);

menu[2][3] = new Item('Paste', '#', defHeight, 0);

menu[3] = new Array();

menu[3][0] = new Menu('helpMenu', 0, 22, 80, defOver, defBack, defBorder);

menu[3][1] = new Item('Contents', '#', defHeight, 0);

menu[3][2] = new Item('Index', '#', defHeight, 0);

menu[3][3] = new Item('About', '#', defHeight, 5);

menu[4] = new Array();

// This is across but not down... a horizontal popout (with crazy colours :)...

menu[4][0] = new Menu('reopenMenu', 85, 0, 100, '#333366', '#666699', '#663399');

menu[4][1] = new Item('Recent Doc 1:<br>Schedule', '#', 36, 0);

menu[4][2] = new Item('Recent Doc 2:<br>Plan', '#', 40, 0);

menu[4][3] = new Item('Etc. etc...', '#', defHeight, 0);

menu[5] = new Array();

// Leftwards popout with a negative x relative to its trigger.

menu[5][0] = new Menu('aboutMenu', -85, -15, 80, defOver, defBack, defBorder);

menu[5][1] = new Item('Leftwards!<br>And up!', '#', 30, 0);

 

newRoot = startDL('rootMenu', 0, 0, '100%', 17, 'hidden', '#006666', null, 100, '');

newRoot += startDL('rootMenu1', 5, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 1));

newRoot += '<span class="Item">  File</span>' + endDL;

newRoot += startDL('rootMenu2', 55, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 2));

newRoot += '<span class="Item">  Edit</span>' + endDL;

newRoot += startDL('rootMenu3', 105, 0, 40, 17, 'inherit', '#006666', null, 100, mouseProps(0, 3));

newRoot += '<span class="Item">  Help</span>' + endDL;

newRoot += endDL;

// Pass this two strings - the first is HTML to write a custom root menu, or null to

// generate one normally. The second is the popout indicator HTML - try an image...?

// Try writeMenus(null, '<img src="...">'); in your own script.

writeMenus(newRoot, '>');

// This is a quick snippet that captures all clicks on the document and hides the menus

// every time you click. Use if you want.

if (isNS4) document.captureEvents(Event.CLICK);

document.onclick = clickHandle;

function clickHandle(evt) {

if (isNS4) document.routeEvent(evt);

hideAllBut(0);

}

// Show root menu command - place in an onLoad="..." type function if you want.

eval(docObj + menu[0][0].id + styObj + '.visibility = "visible"');

// This is just the moving command for the example.

function moveRoot() {

rM = eval(docObj + menu[0][0].id + styObj);

if (parseInt(rM.top) < 40) rM.top = 40;

else rM.top = 0;

}

//  End -->

</script>

 

0 Comments

Mon

02

Mar

2009

178、隐藏菜单3

178、隐藏菜单3

脚本说明:

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

<script language="JavaScript1.2">

 

function move(x) {

if (document.all) {

object1.style.pixelLeft += x;

object1.style.visibility = "visible"}

else if (document.layers) {

document.object1.left += x;

document.object1.visibility = "show"}};

 

function makeStatic() {

if (document.all) {object1.style.pixelTop=document.body.scrollTop+20}

else {eval(document.object1.top=eval(window.pageYOffset+20));}

setTimeout("makeStatic()",0);}

</script>

 

<style>

<!--

 

.hl   {

              Background-Color : yellow;

              Cursor:hand;

       }

.n    {

              Cursor:hand;

       }

-->

</style>

<LAYER visibility="hide" top="20" name="object1" bgcolor="black" left="0" onmouseover="move(132)" onmouseout="move(-132)">

 

<script language="JavaScript1.2">

 

function positionmenu(){

move(-132)

}

 

if (document.all) {document.write('<DIV ID="object1" style="visibility:hidden;cursor:hand; Position : Absolute ;Left : 0px ;Top : 20px ;Z-Index : 20" onmouseover="move(132)" onmouseout="move(-132)">')}

</script>

<table border="0" cellpadding="0" cellspacing="1" width="150" bgcolor="#000000">

<tr><td bgcolor="#0099FF"> <font size="4" face="Arial"><b>Menu</b></font></td>

 

<script language="JavaScript1.2">

document.write('<td align="center" rowspan="100" width="16" bgcolor="#FF6666"><span style="font-size:13px"><p align="center"><font face="Arial Black">S<br>I<br>D<br>E<br>M<br>E<br>N<BR>U</font></p></span></TD>')

</script>

 

</tr>

 

<script language="JavaScript1.2"><!--

if (document.all||document.layers) {

makeStatic();}

 

var text=new Array();

var thelink=new Array();

 

//configure thelinks below. Extend as desired

 

 

 

 

 

 

 

 

text[0]="网络编程";

text[1]="网易";

text[2]="新浪";

text[3]="搜狐";

text[4]="雅虎";

text[5]="江苏音符";

text[6]="常州信息港";

text[7]="网页特效代码";

 

thelink[0]="http://www.7stk.com";

thelink[1]="http://www.163.ocm";

thelink[2]="http://www.sina.com.cn";

thelink[3]="http://www.sohu.com";

thelink[4]="http://www.yahoo.com";

thelink[5]="http://www.7stk.com/music/music.htm";

thelink[6]="http://www.7stk.com/fine/index.htm";

thelink[7]="http://www.7stk.com";

 

 

 

 

 

 

 

 

 

 

 

 

//enter target of above links

//Valid values are '', 'new', or 'framename' (where 'framename' is the name of the frame you wish the links to target)

var linktarget=''

 

///DO NOT EDIT BELOW THIS LINE////////////////

 

function navigateie(which){

if (linktarget=='')

window.location=thelink[which]

else if (linktarget=='new')

window.open(thelink[which])

else{

temp_var=eval("window.parent."+linktarget)

temp_var.location=thelink[which]

}

}

 

for (i=0;i<=text.length-1;i++)

if (document.all) {document.write('<TR><TD height=20 bgcolor=white onclick="navigateie('+i+')" onmouseover="className=\'hl\'" onmouseout="className=\'n\'"><FONT SIZE=2 FACE=ARIAL>&nbsp;'+text[i]+'</FONT></TD></TR>')}

else {document.write('<TR><TD bgcolor="white"><ILAYER><LAYER HEIGHT="18" onmouseover="this.bgColor=\'yellow\'" onmouseout="this.bgColor=\'white\'" width=131><FONT SIZE=2 FACE=ARIAL>&nbsp;<A HREF="'+thelink[i]+'" target="'+linktarget+'" id="nounderline">'+text[i]+'</A></FONT></LAYER></ILAYER></TD></TR>')}

 

//-->

</script>

<tr>

<td bgcolor="#0099FF"><font size="1" face="Arial"> </font></td>

</TR>

</table>

<script language="JavaScript1.2">

if (document.all) {document.write('</DIV>')}

window.onload=positionmenu

</script>

</LAYER>

1 Comments

Mon

02

Mar

2009

177、隐藏菜单2

177、隐藏菜单2

脚本说明:

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

<style>

body{

overflow-x:hidden;

overflow-y:scroll;

}

</style>

 

<script language="JavaScript1.2">

 

var menuwidth=300

//configure scroll speed (1-10), where larger is faster

var scrollspeed=6

//specify menu content

var menucontents='<nobr><a href="http://www.hao123.com/man/club/sinabbs.htm">新浪论坛</a> | <a href="http://www.hao123.com/man/club/263bbs.htm">263论坛</a> | <a href="http://www.hao123.com/man/club/xilubbs.htm">西陆社区</a> | <a href="http://www.hao123.com/man/club/sohubbs.htm">搜狐社区</a> | <a href="http://www.yesky.com/"> </a> | <a href="http://www.21cn.com">世纪网络</a> | <a href="http://www.7stk.com/">网页特效代码</a> | <a href="http://www.sohu.com">搜狐</a></nobr>'

 

 

////NO NEED TO EDIT BELOW THIS LINE////////////

 

var actualwidth=''

var ns_scroll

function fillup(){

if (document.all){

test2.innerHTML=menucontents

actualwidth=test2.offsetWidth

}

else if (document.layers){

ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2

ns_scroll.document.write(menucontents)

ns_scroll.document.close()

actualwidth=ns_scroll.document.width

}

}

window.onload=fillup

 

function moveleft(){

if (document.all&&test2.style.pixelLeft>(menuwidth-actualwidth))

test2.style.pixelLeft-=scrollspeed

else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))

ns_scroll.left-=scrollspeed

lefttime=setTimeout("moveleft()",50)

}

 

function moveright(){

if (document.all&&test2.style.pixelLeft<0)

test2.style.pixelLeft+=scrollspeed

else if (document.layers&&ns_scroll.left<0)

ns_scroll.left+=scrollspeed

righttime=setTimeout("moveright()",50)

}

 

if (document.all||document.layers){

with (document){

write('<table border="0" cellspacing="0" cellpadding="0">')

write('<td valign="middle"><a href=#" onMouseover="moveleft()" onMouseout="clearTimeout(lefttime)"><<<</a> </td>')

write('<td valign="top">')

if (document.all){

write('<span style="position:relative;width:'+menuwidth+';">')

write('<span style="position:absolute;width:'+menuwidth+';clip:rect(0 '+menuwidth+' auto 0)">')

write('<span id="test2" style="position:absolute;left:0;top:0">')

write('</span></span></span>')

}

else if (document.layers){

write('<ilayer width='+menuwidth+' name="ns_scrollmenu">')

write('<layer name="ns_scrollmenu2" left=0 top=0></layer></ilayer>')

}

write('</td>')

write('<td valign="middle"> <a href="http://www.7stk.com/" onMouseover="moveright()" onMouseout="clearTimeout(righttime)">')

write('>>></a>')

write('</td></table>')

}

}

</script>

 

0 Comments

Mon

02

Mar

2009

176、隐藏菜单1

176、隐藏菜单1

脚本说明:

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

<style>

<!--

.iewrap1{

position:relative;

height:30px

}

 

.iewrap2{

position:absolute

}

 

#dropmenu0, #dropmenu1{

visibility:hide;

z-index:100;

}

-->

</style>

    <table border="0" width="100%" cellspacing="0" cellpadding="0">

      <tr>

        <td width="17%">

<script language="JavaScript1.2">

 

var selection0=new Array()

selection0[0]='<font face="Verdana"><small><a href="http://www.163.com">网易</a><br>'

selection0[1]='<a href="http://www.sina.com.cn">新浪</a><br>'

selection0[2]='<a href="http://www.sohu.com">搜狐</a><br>'

selection0[3]='<a href="http://www.7stk.com/">东方网景</a><br>'

selection0[4]='<a href="http://www.21cn.com">世纪网络</a><br>'

selection0[5]='<a href="http://www.yesky.com/"> </a><br></small></font>'

 

 

var selection1=new Array()

selection1[0]='<font face="Verdana"><small><a href="http://www.hao123.com/man/club/club163.htm">网易社区</a><br>'

selection1[1]='<a href="http://www.hao123.com/man/club/sinabbs.htm">新浪论坛</a><br>'

selection1[2]='<a href="http://www.hao123.com/man/club/263bbs.htm">263论坛</a><br>'

selection1[3]='<a href="http://www.hao123.com/man/club/xilubbs.htm">西陆社区</a><br>'

selection1[4]='<a href="http://www.hao123.com/man/club/sohubbs.htm">搜狐社区</a><br></small></font>'

 

</script>

<script language="JavaScript1.2">

var zindex=100

function dropit2(whichone){

if (window.themenu&&themenu.id!=whichone.id)

themenu.style.visibility="hidden"

themenu=whichone

if (document.all){

themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX

themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18

if (themenu.style.visibility=="hidden"){

themenu.style.visibility="visible"

themenu.style.zIndex=zindex++

}

else{

hidemenu()

}

}

}

 

function dropit(e,whichone){

if (window.themenu&&themenu.id!=eval(whichone).id)

themenu.visibility="hide"

themenu=eval(whichone)

if (themenu.visibility=="hide")

themenu.visibility="show"

else

themenu.visibility="hide"

themenu.zIndex++

themenu.left=e.pageX-e.layerX

themenu.top=e.pageY-e.layerY+19

return false

}

 

function hidemenu(whichone){

if (window.themenu)

themenu.style.visibility="hidden"

}

 

function hidemenu2(){

themenu.visibility="hide"

}

 

if (document.all)

document.body.onclick=hidemenu

</script>

 

 

 

<ilayer height=35px>

<layer visibility=show>

<span class="iewrap1">

<span class="iewrap2" onClick="dropit2(dropmenu0);event.cancelBubble=true;return false">

<font face="Verdana"><b><a href="alternate.htm" onClick="if(document.layers) return dropit(event,'document.dropmenu0')">国内知名网站</a></b></font>

</span>

</span>

</layer>

</ilayer></td> <td width="76%">

<ilayer height=35px>

<layer visibility=show>

<span class="iewrap1">

<span class="iewrap2" onClick="dropit2(dropmenu1);event.cancelBubble=true;return false">

<font face="Verdana"><b><a href="alternate.htm" onClick="if(document.layers) return dropit(event,'document.dropmenu1')">社区论坛</a></b></font>

</span>

</span>

</layer>

</ilayer></td>

      </tr>

    </table>

   <script>

<!--

function highlight(x){

document.forms[x].elements[0].focus()

document.forms[x].elements[0].select()

}

//-->

</script>   

<div id="dropmenu0" style="position:absolute;left:0;top:0;layer-background-color:lightyellow;background-color:lightyellow;width:155;visibility:hidden;border:2px solid black;padding:0px">

<script language="JavaScript1.2">

if (document.all)

dropmenu0.style.padding='4px'

for (i=0;i<selection0.length;i++)

document.write(selection0[i])

</script>

</div>

 

<script language="JavaScript1.2">

if (document.layers){

document.dropmenu0.captureEvents(Event.CLICK)

document.dropmenu0.onclick=hidemenu2

}

</script>

<div id="dropmenu1" style="position:absolute;left:0;top:0;layer-background-color:lightyellow;background-color:lightyellow;width:155;visibility:hidden;border:2px solid black;padding:0px">

<script language="JavaScript1.2">

if (document.all)

dropmenu1.style.padding='4px'

for (i=0;i<selection1.length;i++)

document.write(selection1[i])

</script>

</div>

 

<script language="JavaScript1.2">

if (document.layers){

document.dropmenu1.captureEvents(Event.CLICK)

document.dropmenu1.onclick=hidemenu2

}

</script>

 

0 Comments

Mon

02

Mar

2009

175、变化的文字链接

175、变化的文字链接

脚本说明:

第一步:把如下代码加入<body>区域中

<script>

<!--

function correct(){

if (finished){

setTimeout("begin()",3000)

}

return true

}

window.onerror=correct

function begin(){

if (!document.all)

return

if (maxheight==null)

maxheight=temp.offsetHeight

whatsnew.style.height=maxheight

temp.style.display="none"

c=1

finished=true

change()

}

//-->

</script>

 

<style>

<!--

#whatsnew a{color:730073;text-decoration:none}

#whatsnew, #temp {font-weight:bold; font-family:Arial}

#whatsnew a:hover{color:red}

-->

</style>

<script language="javascript1.2">

<!--

 

/*

News Updater Script-

?Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*/

 

var head=''

var top=0

var maxheight

var finished=false

var tickers=new Array()

 

tickers[0]='<a href="http://www.163.com">网易-国内最大的综合性站点</a>'

 

tickers[1]='<a href="http://www.sian.com.cn">新浪网-国内最大的新闻发布站点</a>'

 

tickers[2]='<a href="http://www.sohu.com">搜狐-国内最大的搜索类站点</a>'

 

tickers[3]='<a href="http://www.7stk.com/">江苏音符</a>'

 

tickers[4]='<a href="<b>http://www.cz.jsinfo.net</b>">常州信息港</a>'

 

for (i=1;i<=tickers.length-1;i++){

if (tickers[i].length>=tickers[top].length)

top=i

}

if (document.all)

document.write('<span id="whatsnew" style="width:100%;height=10;filter:revealTrans(duration=2,transition=19)">'+tickers[0]+'</span>')

 

function change(){

whatsnew.innerHTML=''

whatsnew.filters.revealTrans.apply()

whatsnew.filters.revealTrans.play()

whatsnew.innerHTML=tickers[c]

if (c==tickers.length-1)

c=0

else

c+=1

setTimeout("change()",5000)

}

if (document.all)

document.write('<span id=ns style="display:none;">')

//-->

</script>

<!--Insert alternate HTML codes here

that will be seen by browsers OTHER

than IE 4.x-->

</span>

 

<span id=temp style="position:absolute;left:0;top:0" style=&{head};>

<script>

<!--

if (document.all){

temp.style.width=whatsnew.style.width

document.write(tickers[top])

}

//-->

</script>

</span>

 

 

 

第二步:把<body>中的内容改为:

<body onLoad="begin()">

 

0 Comments

Mon

02

Mar

2009

174、带边框的菜单

174、带边框的菜单

脚本说明:

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

<style>

.menulines{

border:1px solid white;

}

 

.menulines a{

text-decoration:none;

color:black;

}

</style>

<script language="JavaScript1.2">

 

function borderize(what,color){

what.style.borderColor=color

}

 

function borderize_on(e){

if (document.all)

source3=event.srcElement

else if (document.getElementById)

source3=e.target

if (source3.className=="menulines"){

borderize(source3,"black")

}

else{

while(source3.tagName!="TABLE"){

source3=document.getElementById? source3.parentNode : source3.parentElement

if (source3.className=="menulines")

borderize(source3,"black")

}

}

}

 

function borderize_off(e){

if (document.all)

source4=event.srcElement

else if (document.getElementById)

source4=e.target

if (source4.className=="menulines")

borderize(source4,"white")

else{

while(source4.tagName!="TABLE"){

source4=document.getElementById? source4.parentNode : source4.parentElement

if (source4.className=="menulines")

borderize(source4,"white")

}

}

}

 

</script>

<table border="0" width="100" cellspacing="0" cellpadding="0" onMouseover="borderize_on(event)" onMouseout="borderize_off(event)">

 

<tr><td width="100%" bgcolor="#E6E6E6"><font face="Arial" size="3"><b>菜单</b></font></td></tr>

<tr><td width="100%" class="menulines"><font face="Arial" size="2"><a href="http://www.hao123.com/man/club/sinabbs.htm">新浪论坛</a></font></td></tr>

<tr><td width="100%" class="menulines"><font face="Arial" size="2"><a href="http://www.hao123.com/man/club/263bbs.htm">263论坛</a></font></td></tr>

<tr><td width="100%" class="menulines"><font face="Arial" size="2"><a href="http://www.hao123.com/man/club/xilubbs.htm">西陆社区</a></font></td></tr>

<tr><td width="100%" class="menulines"><font face="Arial" size="2"><a href="http://www.hao123.com/man/club/sohubbs.htm">搜狐社区</a></font></td></tr>

<tr><td width="100%" class="menulines"><font face="Arial" size="2"><a href="http://www.7stk.com/"> </a></font></td></tr>

</table>

 

0 Comments

Mon

02

Mar

2009

173、有数字导航

173、有数字导航

脚本说明:

第一步:把如下代码存成首页文件

<HTML>

<title>数字导航</title>

<FRAMESET COLS="200,*">

<FRAME SRC="menu.htm" resize  SCROLLING="auto" MARGINHEIGHT="12" MARGINWIDTH="1">

<FRAME SRC="number.htm" resize  name="main" SCROLLING="yes" MARGINHEIGHT="12" MARGINWIDTH="1">

</FRAMESET>

</frameset>

</HTML>

 

 

第二步:把如下代码存成相应的menu.htm文件

<html>

<title>数字导航</title>

<body bgColor=#fef4d9>

<body>

<SCRIPT LANGUAGE="JavaScript">

var phone_num='';

var timerID = null;

var timerRunning = false;

function but1()

{

 

phone_num = phone_num + '1';

 chknum();

}

function but2()

{

 phone_num = phone_num + '2';

 chknum();

}

function but3()

{

 phone_num = phone_num + '3';

 chknum();

}

function but4()

{

 phone_num = phone_num + '4';

 chknum();

}

function but5()

{

 phone_num = phone_num + '5';

 chknum();

}

function but6()

{

 phone_num = phone_num + '6';

 chknum();

}

function but7()

{

 phone_num = phone_num + '7';

 chknum();

}

function but8()

{

 phone_num = phone_num + '8';

 chknum();

}

function but9()

{

 phone_num = phone_num + '9';

 chknum();

}

function but0()

{

 phone_num = phone_num + '0';

 chknum();

}

function chknum()

{

if (phone_num=="007")

 parent.frames.main.location="http://www.7stk.com/";

if (phone_num=="100")

 parent.frames.main.location="http://www.163.com/";

if (phone_num=="200")

 parent.frames.main.location="http://www.yahoo.com.cn";

if (phone_num=="300")

parent.frames.main.location="http://www.sohu.com";

if (phone_num=="400")

parent.frames.main.location="http://www.sina.com.cn/";

if (phone_num=="500")

parent.frames.main.location="http://www.chinaren.com/";

if (phone_num=="600")

parent.frames.main.location="http://www.goldnets.com/";

if (phone_num=="700")

parent.frames.main.location="http://www.china.com/";

if (phone_num=="800")

parent.frames.main.location="http://www.myrice.com/";

if (phone_num=="900")

parent.frames.main.location="http://www.263.net/";

 

 

 

document.board.pn.value=phone_num;

}

function clearit()

{

 phone_num = "";

 document.board.pn.value=phone_num;

}

 

</SCRIPT>

<center>

 

<FORM name="board">

<input type=button value="   1   "onClick=but1()>

<input type=button value="   2   "onClick=but2()>

<input type=button value="   3   "onClick=but3()>

 

<br>

 

<input type=button value="   4   "onClick=but4()>

<input type=button value="   5   "onClick=but5()>

<input type=button value="   6   "onClick=but6()>

 

<br>

 

<input type=button value="   7   "onClick=but7()>

<input type=button value="   8   "onClick=but8()>

<input type=button value="   9   "onClick=but9()>

 

 

<br>

 

 

<input type=button value="   0   "onClick=but0()>

 

 

<br>

 

<input type=text name=pn>

<input type=button value="清除"onClick=clearit()>

<center>

<font face="arial"><font size=2><b><u>下面是链接对照</u></b>

<p  align=left>

007  - 7stk<br>

100  - 网易<br>

200 - 中文雅虎<br>

300 - 搜狐<br>

400 - 新浪网<br>

500 - 中国人<br>

600 - 黄金书屋<br>

700 - 中华网<br>

800 - 多米来<br>

900 - 首都在线<br>

</p></center>

 

第三步:建立一个任意的number.htm文件

0 Comments

Mon

02

Mar

2009

172、链接边的文字说明

172、链接边的文字说明

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function setupDescriptions() {

var x = navigator.appVersion;

y = x.substring(0,4);

if (y>=4) setVariables();

}

var x,y,a,b;

function setVariables(){

if (navigator.appName == "Netscape") {

h=".left=";

v=".top=";

dS="document.";

sD="";

}

else

{

h=".pixelLeft=";

v=".pixelTop=";

dS="";

sD=".style";

   }

}

var isNav = (navigator.appName.indexOf("Netscape") !=-1);

function popLayer(a){

desc = "<table cellpadding=3 border=1 bgcolor=F7F7F7 width=200><td>";

 

if (a==1) desc += "中国最大的综合*站!";

if (a==2) desc += "中国最大的新闻网站!";

if (a==3) desc += "中国最大的搜索引擎网站!";

if (a==4) desc += "江苏最大的综合*站!";

if (a==5) desc += "中国最大的网上游戏站点!";

 

desc += "</td></table>";

 

if(isNav) {

document.object1.document.write(desc);

document.object1.document.close();

document.object1.left=x+25;

document.object1.top=y;

}

else {

object1.innerHTML=desc;

eval(dS+"object1"+sD+h+(x+25));

eval(dS+"object1"+sD+v+y);

   }

}

function hideLayer(a){

if(isNav) {

eval(document.object1.top=a);

}

else object1.innerHTML="";

}

function handlerMM(e){

x = (isNav) ? e.pageX : event.clientX;

y = (isNav) ? e.pageY : event.clientY;

}

if (isNav){

document.captureEvents(Event.MOUSEMOVE);

}

document.onmousemove = handlerMM;

//  End -->

</script>

<div id="object1" style="position:absolute; visibility:show; left:25px; top:-50px; z-index:2">隐藏的层</div>

<a href="http://www.163.com" onMouseOver="popLayer(1)" onMouseOut="hideLayer(-50)">网易</a>

<p>

<a href="http://www.sina.com.cn" onMouseOver="popLayer(2)" onMouseOut="hideLayer(-50)">新浪</a>

<p>

<a href="http://www.sohu.com" onMouseOver="popLayer(3)" onMouseOut="hideLayer(-50)">搜狐</a>

<p>

<a href="http://www.7stk.com/fine/index.htm" onMouseOver="popLayer(4)" onMouseOut="hideLayer(-50)">精彩网页分享</a>

<p>

<a href="http://www.7stk.com/" onMouseOver="popLayer(5)" onMouseOut="hideLayer(-50)">网页特效代码</a></td></tr>

</table></center>

 

第二步:把<body>区域改为

<body bgcolor="#fef4d9" OnLoad="setupDescriptions()">

0 Comments

Mon

02

Mar

2009

171、自动弹出式菜单

171、自动弹出式菜单

 

0 Comments

Mon

02

Mar

2009

170、下拉菜单弹出窗口

170、下拉菜单弹出窗口

脚本说明:

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

<script language="JavaScript">

<!--

DestinationAndTitle=new Array()

DestinationAndTitle[0]="http://www.7stk.com*网页特效代码"

DestinationAndTitle[1]="http://www.163.com*网易"

DestinationAndTitle[2]="http://www.sina.com.cn*新浪网"

DestinationAndTitle[3]="http://www.yahoo.com*雅虎"

DestinationAndTitle[4]="http://www.5460.net*中国同学录"

DestinationAndTitle[5]="http://www.7stk.com/1/index06.htm*天气预报代码"

 

Top=0;

Left=0;

Height=400;

Width=600;

//1 = yes, 0 = no

ToolBar=0;

Location=0;

Directories=0;

Status=0;

MenuBar=0;

Scroll=0;

Resize=0;

function PopUp(){

var url=document.F.S.options[document.F.S.options.selectedIndex].value;

if (url != ''){

 if  (!window.popupwin || popupwin.closed)

 popupwin=open(url,"","top="+Top+",left="+Left+",width="+Width+",height="+Height+",status="+Status+",directories="+Directories+",location="+Location+",toolbar="+ToolBar+",menubar="+MenuBar+"scrollbars="+Scroll+",resizable="+Resize+"");

 else{

 popupwin.close();

 popupwin=open(url,"","top="+Top+",left="+Left+",width="+Width+",height="+Height+",status="+Status+",directories="+Directories+",location="+Location+",toolbar="+ToolBar+",menubar="+MenuBar+"scrollbars="+Scroll+",resizable="+Resize+"");

 }

}

else return false;

}

document.write("<form name='F'><select name='S' onchange=PopUp()> <option value='#'>请选择下面的链接</option>");

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

var urlMsg=DestinationAndTitle[i].split('*')

document.write("<option value="+urlMsg[0]+">"+urlMsg[1])}

document.write("</select></form>");

//-->

</script>

 

0 Comments

Mon

02

Mar

2009

169、左上角点击弹出菜单

169、左上角点击弹出菜单

脚本说明:

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

<style type="text/css">

<!--

#menuBar {position: absolute;left: -200px; width: 300px; top: 0px; clip:     rect(   )}

#glider {position: absolute;left: 200px;top: 0px; width: 80px}

.glideText {font-size: 18px;color: #E2E2E2;text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif}

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

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

a:active {  color: #333333; text-decoration: none}

a:hover {  color: #333333}

.mentd {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; background-color: #999999; background-image:   url(graygrid2.gif)}

td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #333333}

h1 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; color: #FFFFFF}

-->

</style>

<script language="JavaScript">

<!--

 

var pee = -200

var drec = 40;

var speed = 20;

 

//Don't touch!

var l = pee;

 

//Don't touch. This is the function that closes the menu

function Proj7GlideBack () {l += drec;

  if (document.layers) {

    document.menuBar.left = l;

  }

  else if (document.all) {document.all.menuBar.style.pixelLeft = l;

  }

  else if (document.getElementById) {document.getElementById('menuBar').style.left = l + 'px';

  }

  if (l < 0)

    setTimeout('Proj7GlideBack()', speed);

 

else {

         if (document.layers) {

      var html = '';

      html += '<A HREF="javascript:;"';

      html += 'onClick="Proj7GlideOut(); return false;"';

      html += 'Class="glideText"';

      html += 'close'+ '<br>';

      html += 'close'+ '<Br>';

      html += '<\/A>';

      var a = window.document.menuBar.document.glider;

      a.document.open();

      a.document.write(html);

      a.document.close();

    }

    else if (document.all) {document.all.glidetextLink.innerHTML = 'close';

      document.all.glidetextLink.onclick = moveIn;

    }

    else if (document.getElementById) {

      document.getElementById('glidetextLink').firstChild.nodeValue ='close';

      document.getElementById('glidetextLink').onclick = moveIn;

    }

  }

}

//Don't touch. This is the function that opens the menu

function Proj7GlideOut () {l -= drec;

  if (document.layers) {document.menuBar.left = l;

  }

  else if (document.all) {document.all.menuBar.style.pixelLeft = l;

  }

  else if (document.getElementById) {document.getElementById('menuBar').style.left = l + 'px';

  }

  if (l > pee)

    setTimeout('Proj7GlideOut()', speed);

  else {

    if (document.layers) {

      var html = '';

      html += '<A HREF="javascript:;"';

      html += 'onclick="Proj7GlideBack(); return false;"';

      html += 'Class="glideText"';

      html += 'menu'+ '<Br>';

      html += 'menu'+ '<Br>';

      html += '<\/A>';

      var a = window.document.menuBar.document.glider;

      a.document.open();

      a.document.write(html);

      a.document.close();

    }

    else if (document.all) {document.all.glidetextLink.innerHTML = 'menu';

      document.all.glidetextLink.onclick = moveOut;

    }

    else if (document.getElementById) {

      document.getElementById('glidetextLink').firstChild.nodeValue ='menu';

      document.getElementById('glidetextLink').onclick = moveOut;

    }

  }

}

function moveIn () {Proj7GlideOut();return false;

}

function moveOut() {Proj7GlideBack();return false;

}

 

<!--NNresizeFix Reloads the page to workaround a Netscape Bug-->

if (document.layers) {

origWidth = innerWidth;

origHeight = innerHeight;}

function reDo() {

if (innerWidth != origWidth || innerHeight != origHeight)

location.reload();}

if (document.layers) onresize = redo;

//-->

</script>

            <div ID="menuBar" style="">

              <table width="272" border="0" cellspacing="0" cellpadding="0" bgcolor="#333333">

                <tr>

                  <td>

                    <table width="100%" border="0" cellpadding="8" cellspacing="1">

                      <tr>

                        <td bgcolor="#FF9900" valign="top" class="mentd">

                                                     <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Home</a><Br>

                            <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Link

                            Two </a><Br>

                            <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Project

                            VII Home</a><Br>

                            <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Project

                            VII Design Packs</a><Br>

                            <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Link

                            Number Five</a><Br>

                            <a href="http://www.1stscript.com" onFocus="if(this.blur)this.blur()" class="menu">Link

                            Number Six</a>

                        </td>

                        <td width="72" bgcolor="#9999CC"> 

                        </td>

                      </tr>

                    </table>

                  </td>

                </tr>

              </table>

              <span ID="glider" style="">

              <table border="0" cellspacing="0" cellpadding="0">

                <tr align="center">

                  <td><a id="glidetextLink"

   href="javascript:;"

   class="glideText"

   onClick="Proj7GlideBack(); return false" onFocus="if(this.blur)this.blur()"> menu </a></td>

                </tr>

              </table></span> </div>

 

0 Comments

Mon

02

Mar

2009

168、鼠标移动导出菜单

168、鼠标移动导出菜单

脚本说明:

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

<style>

<!--

 

#slidemenubar, #slidemenubar2{

position:absolute;

left:-155px;

width:160px;

top:170px;

border:1.5px solid green;

background-color:lightyellow;

layer-background-color:lightyellow;

font:bold 12px Verdana;

line-height:20px;

}

-->

</style>

<script language="JavaScript1.2">

 

if (document.all)

document.write('<div id="slidemenubar2" style="left:-150" onMouseover="pull()" onMouseout="draw()">')

</script>

<layer id="slidemenubar" onMouseover="pull()" onMouseout="draw()">

<script language="JavaScript1.2">

var sitems=new Array()

var sitemlinks=new Array()

 

//extend or shorten this list

sitems[0]="新浪网"

sitems[1]="网易"

sitems[2]="搜狐"

sitems[3]="雅虎"

sitems[4]="音乐电台代码"

sitems[5]="精彩网页分享"

sitems[6]="网页特效代码"

 

 

 

//These are the links pertaining to the above text.

sitemlinks[0]="http://www.sina.com.cn"

sitemlinks[1]="http://www.163.com"

sitemlinks[2]="http://www.sohu.com"

sitemlinks[3]="http://www.yahoo.com"

sitemlinks[4]="http://www.7stk.com/radio/radio.htm"

sitemlinks[5]="http://www.7stk.com/fine/index.htm"

sitemlinks[6]="http://www.7stk.com/"

 

for (i=0;i<=sitems.length-1;i++)

document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>')

</script>

</layer>

<script language="JavaScript1.2">

function regenerate(){

window.location.reload()

}

function regenerate2(){

if (document.layers)

setTimeout("window.onresize=regenerate",400)

}

window.onload=regenerate2

if (document.all){

document.write('</div>')

themenu=document.all.slidemenubar2.style

rightboundary=0

leftboundary=-150

}

else{

themenu=document.layers.slidemenubar

rightboundary=150

leftboundary=10

}

function pull(){

if (window.drawit)

clearInterval(drawit)

pullit=setInterval("pullengine()",50)

}

function draw(){

clearInterval(pullit)

drawit=setInterval("drawengine()",50)

}

function pullengine(){

if (document.all&&themenu.pixelLeft<rightboundary)

themenu.pixelLeft+=5

else if(document.layers&&themenu.left<rightboundary)

themenu.left+=5

else if (window.pullit)

clearInterval(pullit)

}

function drawengine(){

if (document.all&&themenu.pixelLeft>leftboundary)

themenu.pixelLeft-=5

else if(document.layers&&themenu.left>leftboundary)

themenu.left-=5

else if (window.drawit)

clearInterval(drawit)

}

</script>

 

0 Comments

Mon

02

Mar

2009

167、热键显示隐藏菜单

167、热键显示隐藏菜单

脚本说明:

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

<style>

<!--

 

#slidemenubar, #slidemenubar2{

position:absolute;

left:-165px;

width:90px;

top:170px;

border:1.5px solid green;

background-color:lightyellow;

layer-background-color:lightyellow;

font:bold 12px Verdana;

line-height:20px;

}

-->

</style>

<script language="JavaScript1.2">

 

function showtip(nulling){

if (document.all){

if (nulling==0&&slidemenubar2.style.pixelLeft==-150)

slidemenubar2.title=' "x" 显示菜单, "z" 隐藏菜单'

else

slidemenubar2.title=''

}

else if (document.layers){

if (nulling==0&&!window.pullit)

window.status=' "x" 显示菜单, "z" 隐藏菜单'

else

window.status=''

}

}

if (document.all)

document.write('<div id="slidemenubar2" style="left:-150" onMouseover="showtip(0)" onMouseout="showtip(1)">')

</script>

<layer id="slidemenubar" onMouseover="showtip(0)" onMouseout="showtip(1)">

<script language="JavaScript1.2">

var sitems=new Array()

var sitemlinks=new Array()

 

//extend or shorten this list

sitems[0]="新浪网"

sitems[1]="网易"

sitems[2]="搜狐"

sitems[3]="雅虎"

sitems[4]="音乐电台代码"

sitems[5]="精彩网页分享"

sitems[6]="网页特效代码"

 

 

 

//These are the links pertaining to the above text.

sitemlinks[0]="http://www.sina.com.cn"

sitemlinks[1]="http://www.163.com"

sitemlinks[2]="http://www.sohu.com"

sitemlinks[3]="http://www.yahoo.com"

sitemlinks[4]="http://www.7stk.com/radio/radio.htm"

sitemlinks[5]="http://www.7stk.com/fine/index.htm"

sitemlinks[6]="http://www.7stk.com/"

 

for (i=0;i<=sitems.length-1;i++)

document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>')

</script>

</layer>

<script language="JavaScript1.2">

 

function regenerate(){

window.location.reload()

}

function regenerate2(){

if (document.layers)

setTimeout("window.onresize=regenerate",400)

}

window.onload=regenerate2

if (document.all){

document.write('</div>')

themenu=document.all.slidemenubar2.style

rightboundary=0

leftboundary=-150

}

else{

themenu=document.layers.slidemenubar

rightboundary=150

leftboundary=10

}

function pull(){

if (window.drawit)

clearInterval(drawit)

pullit=setInterval("pullengine()",50)

}

function draw(){

clearInterval(pullit)

drawit=setInterval("drawengine()",50)

}

function pullengine(){

if (document.all&&themenu.pixelLeft<rightboundary)

themenu.pixelLeft+=5

else if(document.layers&&themenu.left<rightboundary)

themenu.left+=5

else if (window.pullit)

clearInterval(pullit)

}

function drawengine(){

if (document.all&&themenu.pixelLeft>leftboundary)

themenu.pixelLeft-=5

else if(document.layers&&themenu.left>leftboundary)

themenu.left-=5

else if (window.drawit)

clearInterval(drawit)

}

 

if (document.layers)

document.captureEvents(Event.KEYPRESS)

function menuengine(e){

if (document.layers){

if (e.which==120)

pull()

if (e.which==122)

draw()

}

else if (document.all){

if (event.keyCode==120)

pull()

if (event.keyCode==122)

draw()

}

}

document.onkeypress=menuengine

</script>

 

0 Comments

Mon

02

Mar

2009

166、互换导航条

166、互换导航条

脚本说明:

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

<style>

 

#menuShow{

border: 1px solid #6cccc6;

background-color: #11cccc;

padding: 13px;

font-size: 13px;

font-family: Verdana, Arial;

position: absolute;

width: auto;

height: auto;

}

 

#menuSelect{

border: 1px solid #fffff6;

background-color: #aafff1;

padding: 13px;

font-size: 13px;

font-family: Verdana, Arial;

position: absolute;

width: auto;

height: auto;

}

 

</style>

<div id="menuSelect">

<a href="#" onClick="moveOnMenu();moveOffSelector()">交换导航</a>

<br>

<br>

<a href="http://www.163.com">网易</a><br>

<a href="http://www.sohu.com">搜狐</a><br>

<a href="http://www.cctv.com">央视国际</a><br>

<br>

<a href="http://www.163.com">网易</a><br>

<a href="http://www.sohu.com">搜狐</a><br>

<a href="http://www.cctv.com">央视国际</a><br>

<br>

<a href="http://www.163.com">网易</a><br>

<a href="http://www.sohu.com">搜狐</a><br>

<a href="http://www.cctv.com">央视国际</a><br>

</div>

<div id="menuShow">

<a href="#" onClick="moveOffMenu();moveOnSelector()">★交换导航</a>

<br>

<br>

<a href="http://www.sina.com">新浪</a><br>

<a href="http://www.001street.com">网页特效代码</a><br>

<a href="http://www.yahoo.com">雅虎</a><br>

<br>

<a href="http://www.sina.com">新浪</a><br>

<a href="http://www.7stk.com/">一号街</a><br>

<a href="http://www.yahoo.com">雅虎</a><br>

<br>

<a href="http://www.sina.com">新浪</a><br>

<a href="http://www.7stk.com/">一号街</a><br>

<a href="http://www.yahoo.com">雅虎</a><br>

</div>

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

 

Show ="yes";

 

 

 

var OffX = -150;

 

 

 

var PosX =  250;

var PosY =  100;

 

 

var speed        = 1;

var increment    = 1;

var incrementNS4 = 5; // for slower NS4 browsers

 

 

var is_NS = navigator.appName=="Netscape";

var is_Ver = parseInt(navigator.appVersion);

var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5;

var is_NS5up = is_NS&&is_Ver>=5;

 

var MenuX = OffX;

var SelX = PosX;

var sPosX = PosX;

var sOffX = OffX;

 

if (Show == "yes") {

sPosX = OffX;

sOffX = PosX;

MenuX = sOffX;

SelX = sPosX;

}

 

if (is_NS4) {

increment = incrementNS4;

Lq = "document.layers.";

Sq = "";

eval(Lq+'menuSelect'+Sq+'.left=sPosX');

eval(Lq+'menuShow'+Sq+'.left=sOffX');

eval(Lq+'menuSelect'+Sq+'.top=PosY');

eval(Lq+'menuShow'+Sq+'.top=PosY');

} else {

Lq = "document.all.";

Sq = ".style";

document.getElementById('menuSelect').style.left = sPosX+"px";

document.getElementById('menuShow').style.left = sOffX+"px";

document.getElementById('menuSelect').style.top = PosY+"px";

document.getElementById('menuShow').style.top = PosY+"px";

} 

 

function moveOnMenu() {

if (MenuX < PosX) {

MenuX = MenuX + increment;

if (is_NS5up) {

document.getElementById('menuShow').style.left = MenuX+"px";

} else {

eval(Lq+'menuShow'+Sq+'.left=MenuX');

}

setTimeout('moveOnMenu()',speed);

   }

}

 

function moveOffMenu() {

if (MenuX > OffX) {

MenuX = MenuX - increment;

if (is_NS5up) {

document.getElementById('menuShow').style.left = MenuX+"px";

} else {

eval(Lq+'menuShow'+Sq+'.left=MenuX');

}

setTimeout('moveOffMenu()',speed);

   }

}

 

function moveOffSelector() {

if (SelX > OffX) {

SelX = SelX - increment;

if (is_NS5up) {

document.getElementById('menuSelect').style.left = SelX+"px";

} else {

eval(Lq+'menuSelect'+Sq+'.left=SelX');

}

setTimeout('moveOffSelector()',speed);

   }

}

 

function moveOnSelector() {

if (SelX < PosX) {

SelX = SelX + increment;

if (is_NS5up) {

document.getElementById('menuSelect').style.left = SelX+"px";

} else {

eval(Lq+'menuSelect'+Sq+'.left=SelX');

}

setTimeout('moveOnSelector()',speed);

   }

}

//  End -->

</script>

0 Comments

Mon

02

Mar

2009

165、渐显的导航菜单

165、渐显的导航菜单

脚本说明:

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

<STYLE type=TEXT/CSS>

A {

       TEXT-DECORATION: none

}

A:hover {

       COLOR: #ff9900; TEXT-DECORATION: underline

}

TD {

       FONT-SIZE: 9pt; LINE-HEIGHT: 13pt

}

TH {

       FONT-SIZE: 9pt; LINE-HEIGHT: 13pt

}

BODY {

       FONT-SIZE: 9pt; LINE-HEIGHT: 13pt

}

#mnu {

       FILTER: revealTrans(Duration=1.5,Transition=12) visibility:hide

}

</STYLE>

 

<SCRIPT>

function set_mnu()

{

if (mnu.style.visibility=="hidden")

       {

//产生效果和把图层显示

       mnu.filters.revealTrans.apply();

       mnu.style.visibility="visible";

       mnu.filters.revealTrans.play();

       }

else{

//隐藏图层和停止效果播放

       mnu.filters.revealTrans.stop();

       mnu.style.visibility="hidden" ;

       }

}  

</SCRIPT>

<A href="javascript:set_mnu(mnu);">显示菜单</A>

                  <DIV id=mnu

                  style="HEIGHT: 10px; LEFT: 1px; POSITION: relative; TOP: 1px; VISIBILITY: hidden; WIDTH: 93px; Z-INDEX: 1">

                  <TABLE border=1 borderColorDark=#ffffff

                  borderColorLight=#000000 cellPadding=2 cellSpacing=0

                  width="100%">

                    <TBODY>

                    <TR bgColor=#6699cc>

                      <TD><A href="http://www.7stk.com"><FONT

                        color=#ffffff>网页特效代码</FONT></A></TD></TR>

                    <TR bgColor=#6699cc>

                      <TD><A

                        href="http://www.163.com"><FONT

                        color=#ffffff>网易</FONT></A></TD></TR>

                    <TR bgColor=#6699cc>

                      <TD><A

                        href="http://www.sina.com.cn"><FONT

                        color=#ffffff>新浪</FONT></A></TD></TR>

                    <TR bgColor=#6699cc>

                      <TD height=13><A

                        href="http://www.7stk.com/1/index06.htm" ><FONT

                        color=#ffffff>天气预报代码</FONT></A></TD></TR></TBODY></TABLE></DIV>

0 Comments

Mon

02

Mar

2009

164、页面从屏幕飞出

164、页面从屏幕飞出

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function expand() {

for(x = 0; x < 50; x++) {

window.moveTo(screen.availWidth * -(x - 50) / 100, screen.availHeight * -(x - 50) / 100);

window.resizeTo(screen.availWidth * x / 50, screen.availHeight * x / 50);

}

window.moveTo(0,0);

window.resizeTo(screen.availWidth, screen.availHeight);

}

//  End -->

</script>

<a href="http://www.7stk.com" onClick="expand();">网页特效代码</a>

 

0 Comments

Mon

02

Mar

2009

163、图片滚动可带链接

163、图片滚动可带链接

脚本说明:

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

<script language="JavaScript1.2">

 

var scrollerwidth=100

var scrollerheight=56

var scrollerbgcolor='white'

//3000 miliseconds=3 seconds

var pausebetweenimages=3000

 

 

//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag

var slideimages=new Array()

slideimages[0]='<a href="http://www.7stk.com/"><img src="image1.gif" border=0"></a>'

slideimages[1]='<img src="image2.gif">'

slideimages[2]='<img src="image3.gif">'

slideimages[3]='<img src="pe01805a.gif">'

slideimages[4]='<img src="pe02054a.gif">'

   

 

if (slideimages.length>1)

i=2

else

i=0

 

function move1(whichlayer){

tlayer=eval(whichlayer)

if (tlayer.left>0&&tlayer.left<=5){

tlayer.left=0

setTimeout("move1(tlayer)",pausebetweenimages)

setTimeout("move2(document.main.document.second)",pausebetweenimages)

return

}

if (tlayer.left>=tlayer.document.width*-1){

tlayer.left-=5

setTimeout("move1(tlayer)",100)

}

else{

tlayer.left=scrollerwidth+5

tlayer.document.write(slideimages[i])

tlayer.document.close()

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move2(whichlayer){

tlayer2=eval(whichlayer)

if (tlayer2.left>0&&tlayer2.left<=5){

tlayer2.left=0

setTimeout("move2(tlayer2)",pausebetweenimages)

setTimeout("move1(document.main.document.first)",pausebetweenimages)

return

}

if (tlayer2.left>=tlayer2.document.width*-1){

tlayer2.left-=5

setTimeout("move2(tlayer2)",100)

}

else{

tlayer2.left=scrollerwidth+5

tlayer2.document.write(slideimages[i])

tlayer2.document.close()

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move3(whichdiv){

tdiv=eval(whichdiv)

if (tdiv.style.pixelLeft>0&&tdiv.style.pixelLeft<=5){

tdiv.style.pixelLeft=0

setTimeout("move3(tdiv)",pausebetweenimages)

setTimeout("move4(second2)",pausebetweenimages)

return

}

if (tdiv.style.pixelLeft>=tdiv.offsetWidth*-1){

tdiv.style.pixelLeft-=5

setTimeout("move3(tdiv)",100)

}

else{

tdiv.style.pixelLeft=scrollerwidth

tdiv.innerHTML=slideimages[i]

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function move4(whichdiv){

tdiv2=eval(whichdiv)

if (tdiv2.style.pixelLeft>0&&tdiv2.style.pixelLeft<=5){

tdiv2.style.pixelLeft=0

setTimeout("move4(tdiv2)",pausebetweenimages)

setTimeout("move3(first2)",pausebetweenimages)

return

}

if (tdiv2.style.pixelLeft>=tdiv2.offsetWidth*-1){

tdiv2.style.pixelLeft-=5

setTimeout("move4(second2)",100)

}

else{

tdiv2.style.pixelLeft=scrollerwidth

tdiv2.innerHTML=slideimages[i]

if (i==slideimages.length-1)

i=0

else

i++

}

}

 

function startscroll(){

if (document.all){

move3(first2)

second2.style.left=scrollerwidth

}

else if (document.layers){

document.main.visibility='show'

move1(document.main.document.first)

document.main.document.second.left=scrollerwidth+5

document.main.document.second.visibility='show'

}

}

 

window.onload=startscroll

 

</script>

<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}; visibility=hide>

<layer id="first" left=1 top=0 width=&{scrollerwidth}; >

<script language="JavaScript1.2">

if (document.layers)

document.write(slideimages[0])

</script>

</layer>

<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>

<script language="JavaScript1.2">

if (document.layers)

document.write(slideimages[1])

</script>

</layer>

</ilayer>

<script language="JavaScript1.2">

if (document.all){

document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+'">')

document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')

document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:1;top:0;">')

document.write(slideimages[0])

document.writeln('</div>')

document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')

document.write(slideimages[1])

document.writeln('</div>')

document.writeln('</div>')

document.writeln('</span>')

}

</script>

0 Comments

Mon

02

Mar

2009

162、动态下拉菜单导航

162、动态下拉菜单导航

脚本说明:

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

<FORM name=menuform>

<SELECT  size=1  name=msg>

<OPTION  value="http://www.7stk.com" selected>网页特效代码</option>

<option value="http://www.7stk.com/fine/index.htm">精彩网页分享</option>

<option value="http://www.7stk.com/radio/radio.htm">音乐电台代码</option>

<option value="http://www.7stk.com/music/music.htm">音乐播放器</option>

<option value="http://www.7stk.com/1/index06.htm">天气预报代码 </option>

<option value="http://www.163.com/">163.com</option><option value="http://www.sohu.com/">www.sohu</option>

<option value="http://www.sina.com.cn">sina.com.cn</option>

<option value="http://www.yahoo.com.cn">yahoo.com.cn</option>

</SELECT><A   href="javascript:go();"><IMG alt="点击这里导航"   src="go0613.gif"   width=24 align=absMiddle border=0></a></FORM>

<SCRIPT language=javascript>

<!-- Begin

 

function go() {

document.location = document.menuform.msg.options[document.menuform.msg.selectedIndex].value

}

function rotate() {

menu = document.menuform.msg;

chosen = menu.selectedIndex;

menu.selectedIndex= (chosen == (menu.length-1)) ? 0 : chosen + 1;

setTimeout("rotate()",2000);

}

rotate();

// End -->

</SCRIPT>

 

0 Comments

Mon

02

Mar

2009

161、又一右键入导航

161、又一右键入导航

脚本说明:

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

<script language="javaScript">

<!--

 menuItems = new Array();

 menuItemNum = 0;

 

 function addMenuItem(text, url, img){

  if(img) menuItems[menuItemNum] = new Array(text, url, img);

  else if(text) menuItems[menuItemNum] = new Array(text, url);

  else menuItems[menuItemNum] = new Array();

  menuItemNum++;

 }

 

 menuWidth = 109; //menu width

 menuHeight = 176; //menu height

 menuDelay = 50; //delay before menu appears

 menuSpeed = 8; //speed which menu appears (lower=faster)

 menuOffset = 2; //offset of menu from mouse pointer

 

  addMenuItem("<center>网页特效代码</center>","http://www.7stk.com/");

 addMenuItem();

 addMenuItem("精彩网页分享","http://www.jsinfo.net");

 addMenuItem("第九城市","http://www.7stk.com/fine/index.htm");

 addMenuItem("新浪网","http://www.sina.com");

 addMenuItem();

 addMenuItem("音乐电台代码","http://www.7stk.com/radio/radio.htm");

 addMenuItem("音乐播放器","http://www.7stk.com/music/music.htm");

 addMenuItem("天气预报代码","http://www.7stk.com/1/index06.htm");

 addMenuItem("BBC News","http://www.7stk.com/flash/flash.htm");

 addMenuItem("菜单特效代码","http://www.7stk.com/caidan/caidan.htm");

 

 ///////////////////////////////////////////////////////////////////////////////

 // do not edit the code below, it is required for the menu to work correctly

 ///////////////////////////////////////////////////////////////////////////////

 

 

 if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)

  isIe = 1;

 else

  isIe = 0;

 

 if(isIe){

  menuContent = '<table id="rightMenu" width="0" height="0" cellspacing="0" cellpadding="0" style="font:menu;color:menutext;"><tr height="1"><td style="background:threedlightshadow" colspan="4"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight" colspan="2"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="10"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"><table cellspacing="0" cellpadding="0" nowrap style="font:menu;color:menutext;cursor:default;">';

  for(m=0;m<menuItems.length;m++){

   if(menuItems[m][0] && menuItems[m][2])

    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap><img src="' + menuItems[m][2] + '"></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';

   else if(menuItems[m][0])

    menuContent += '<tr height="17" onMouseOver="this.style.background=\'highlight\';this.style.color=\'highlighttext\';" onMouseOut="this.style.background=\'threedface\';this.style.color=\'menutext\';" onClick="parent.window.location.href=\'' + menuItems[m][1] + '\'"><td style="background:threedface" width="1" nowrap></td><td width="21" nowrap></td><td nowrap>' + menuItems[m][0] + '</td><td width="21" nowrap></td><td style="background:threedface" width="1" nowrap></td></tr>';

   else

    menuContent += '<tr><td colspan="5" height="4"></td></tr><tr><td colspan="5"><table cellspacing="0"><tr><td width="2" height="1"></td><td width="0" height="1" style="background:threedshadow"></td><td width="2" height="1"></td></tr><tr><td width="2" height="1"></td><td width="100%" height="1" style="background:threedhighlight"></td><td width="2" height="1"></td></tr></table></td></tr><tr><td colspan="5" height="3"></td></tr>';

  }

  menuContent += '</table></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedhighlight"></td><td style="background:threedface"></td><td style="background:threedshadow"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threedlightshadow"></td><td style="background:threedshadow" colspan="3"></td><td style="background:threeddarkshadow"></td></tr><tr height="1"><td style="background:threeddarkshadow" colspan="5"></td></tr></table>';

 

  menuPopup = window.createPopup();

  menuPopup.document.body.innerHTML = menuContent;

 }

 

 function showMenu(){

  menuXPos = event.clientX + menuOffset;

  menuYPos = event.clientY + menuOffset;

 

  menuXIncrement = menuWidth / menuSpeed;

  menuYIncrement = menuHeight / menuSpeed;

 

  menuTimer = setTimeout("openMenu(0,0)", menuDelay);

 

  return false;

 }

 

 

 function openMenu(height, width){

  iHeight = height;

  iWidth = width;

 

  menuPopup.show(menuXPos, menuYPos, iWidth, iHeight, document.body);

 

  if(iHeight < menuHeight)

   menuTimer = setTimeout("openMenu(iHeight + menuYIncrement, iWidth + menuXIncrement)", 1);

  else

   clearTimeout(menuTimer);

 }

 

 

 if(isIe) document.oncontextmenu = showMenu;

 

 

//-->

</script>

 

0 Comments

Mon

02

Mar

2009

160、右键导航(IE5.5以上)

160、右键导航(IE5.5以上)

脚本说明:

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

<script language="JavaScript1.2">

<!--

var isie=0;

if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {

isie=1;

}

else {

isie=0;

}

if(isie) {

var html="";

html+='<TABLE STYLE="border:1pt solid #808080" BGCOLOR="#CCCCCC" WIDTH="140" HEIGHT="220" CELLPADDING="0" CELLSPACING="1">';

html+='<ST'+'YLE TYPE="text/css">\n';

html+='a:link {text-decoration:none;font-family:Arial;font-size:8pt;}\n';

html+='a:visited {text-decoration:none;font-family:Arial;font-size:8pt;}\n';

html+='td {font-size:8pt;}\n';

html+='</ST'+'YLE>\n';

html+='<SC'+'RIPT LANGUAGE="JavaScript">\n';

html+='\n<'+'!--\n';

html+='window.onerror=null;\n';

html+='/'+' -'+'->\n';

html+='</'+'SCRIPT>\n';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i0" ONMOUSEOVER="document.all.i0.style.background=\'#CFD6E8\';document.all.i0.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i0.style.background=\'#CCCCCC\';document.all.i0.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.history.go(-1);">  返回</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i1" ONMOUSEOVER="document.all.i1.style.background=\'#CFD6E8\';document.all.i1.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i1.style.background=\'#CCCCCC\';document.all.i1.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.history.go(1);">  前进</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"></TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i4" ONMOUSEOVER="document.all.i4.style.background=\'#CFD6E8\';document.all.i4.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i4.style.background=\'#CCCCCC\';document.all.i4.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.external.AddFavorite(window.top.location.href,window.top.document.title);">  加入收藏夹...</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i5" ONMOUSEOVER="document.all.i5.style.background=\'#CFD6E8\';document.all.i5.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i5.style.background=\'#CCCCCC\';document.all.i5.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.location=\'view-source:\'+window.parent.location.href;">  看源代码</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"></TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i6" ONMOUSEOVER="document.all.i6.style.background=\'#CFD6E8\';document.all.i6.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i6.style.background=\'#CCCCCC\';document.all.i6.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.print();">  打印</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i7" ONMOUSEOVER="document.all.i7.style.background=\'#CFD6E8\';document.all.i7.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i7.style.background=\'#CCCCCC\';document.all.i7.style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.location.href=window.parent.location.href;">  Refresh</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"></TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i8" ONMOUSEOVER="document.all.i8.style.background=\'#CFD6E8\';document.all.i8.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i8.style.background=\'#CCCCCC\';document.all.i8.style.border=\'1pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=1.6; else window.parent.document.body.style.zoom=1.6;">  Zoom In</TD></TR>';

 

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i9" ONMOUSEOVER="document.all.i9.style.background=\'#CFD6E8\';document.all.i9.style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i9.style.background=\'#CCCCCC\';document.all.i9.style.border=\'1pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=0.625; else window.parent.document.body.style.zoom=0.625;">  Zoom Out</TD></TR>';

 

html+='</TABLE>';

 

var oPopup = window.createPopup();

 

}

 

function dopopup(x,y) {

if(isie) {

var oPopupBody = oPopup.document.body;

oPopupBody.innerHTML = html;

oPopup.show(x, y, 140, 220, document.body);

}

}

 

function click(e) {

if(isie) {

if(document.all) {

if(event.button==2||event.button==3) {

dopopup(event.x-1,event.y-1);

}

}

}

}

 

if(isie) {

document.oncontextmenu = function() { dopopup(event.x,event.y);return false; }

document.onmousedown = click;

}

// -->

</script>

</script>

0 Comments

Mon

02

Mar

2009

159、导航说明效果

159、导航说明效果

脚本说明:

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

<DIV id=overDiv style="Z-INDEX: 1; WIDTH: 100px; POSITION: absolute"></DIV>

<SCRIPT language=JavaScript>

// Main background color (the large area)

// Usually a bright color (white, yellow etc)

       if (typeof fcolor == 'undefined') { var fcolor = "#CFCEB6";}

      

// Border color and color of caption

// Usually a dark color (black, brown etc)

       if (typeof backcolor == 'undefined') { var backcolor = "#CFCEB6";}

      

      

// Text color

// Usually a dark color

       if (typeof textcolor == 'undefined') { var textcolor = "#000000";}

      

// Color of the caption text

// Usually a bright color

       if (typeof capcolor == 'undefined') { var capcolor = "#000000";}

      

// Color of "Close" when using Sticky

// Usually a semi-bright color

       if (typeof closecolor == 'undefined') { var closecolor = "#000000";}

      

      

// Width of the popups in pixels

// 100-300 pixels is typical

       if (typeof width == 'undefined') { var width = "200";}

      

// How thick the border should be in pixels

// 1-3 pixels is typical

       if (typeof border == 'undefined') { var border = "3";}

      

      

// How many pixels to the right/left of the cursor to show the popup

// Values between 3 and 12 are best

       if (typeof offsetx == 'undefined') { var offsetx = 12;}

      

// How many pixels to the below the cursor to show the popup

// Values between 3 and 12 are best

       if (typeof offsety == 'undefined') { var offsety = 12;}

      

ns4 = (document.layers)? true:false

ie4 = (document.all)? true:false

 

// Microsoft Stupidity Check.

if (ie4) {

       if (navigator.userAgent.indexOf('MSIE 5')>0) {

              ie5 = true;

       } else {

              ie5 = false; }

} else {

       ie5 = false;

}

 

var x = 0;

var y = 0;

var snow = 0;

var sw = 0;

var cnt = 0;

var dir = 1;

var tr = 1;

if ( (ns4) || (ie4) ) {

       if (ns4) over = document.overDiv

       if (ie4) over = overDiv.style

       document.onmousemove = mouseMove

       if (ns4) document.captureEvents(Event.MOUSEMOVE)

}

 

// Public functions to be used on pages.

 

// Simple popup right

function drs(text) {

       dts(1,text);

}

 

// Caption popup right

function drc(text, title) {

       dtc(1,text,title);

}

 

// Sticky caption right

function src(text,title) {

       stc(1,text,title);

}

 

// Simple popup left

function dls(text) {

       dts(0,text);

}

 

// Caption popup left

function dlc(text, title) {

       dtc(0,text,title);

}

 

// Sticky caption left

function slc(text,title) {

       stc(0,text,title);

}

 

// Simple popup center

function dcs(text) {

       dts(2,text);

}

 

// Caption popup center

function dcc(text, title) {

       dtc(2,text,title);

}

 

// Sticky caption center

function scc(text,title) {

       stc(2,text,title);

}

 

// Clears popups if appropriate

function nd() {

       if ( cnt >= 1 ) { sw = 0 };

       if ( (ns4) || (ie4) ) {

              if ( sw == 0 ) {

                     snow = 0;

                     hideObject(over);

              } else {

                     cnt++;

              }

       }

}

 

// Non public functions. These are called by other functions etc.

 

// Simple popup

function dts(d,text) {

       txt = "<TABLE WIDTH="+width+" BORDER=1 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"宋体\" COLOR=\""+textcolor+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"

       layerWrite(txt);

       dir = d;

       disp();

}

 

// Caption popup

function dtc(d,text, title) {

       txt = "<TABLE WIDTH="+width+" BORDER=1 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"

       layerWrite(txt);

       dir = d;

       disp();

}

 

// Sticky

function stc(d,text, title) {

       sw = 1;

       cnt = 0;

       txt = "<TABLE WIDTH="+width+" BORDER=1 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"

       layerWrite(txt);

       dir = d;

       disp();

       snow = 0;

}

 

// Common calls

function disp() {

       if ( (ns4) || (ie4) ) {

              if (snow == 0)       {

                     if (dir == 2) { // Center

                            moveTo(over,x+offsetx-(width/2),y+offsety);

                     }

                     if (dir == 1) { // Right

                            moveTo(over,x+offsetx,y+offsety);

                     }

                     if (dir == 0) { // Left

                            moveTo(over,x-offsetx-width,y+offsety);

                     }

                     showObject(over);

                     snow = 1;

              }

       }

// Here you can make the text goto the statusbar.

}

 

// Moves the layer

function mouseMove(e) {

       if (ns4) {x=e.pageX; y=e.pageY;}

       if (ie4) {x=event.x; y=event.y;}

       if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}

       if (snow) {

              if (dir == 2) { // Center

                     moveTo(over,x+offsetx-(width/2),y+offsety);

              }

              if (dir == 1) { // Right

                     moveTo(over,x+offsetx,y+offsety);

              }

              if (dir == 0) { // Left

                     moveTo(over,x-offsetx-width,y+offsety);

              }

       }

}

 

// The Close onMouseOver function for Sticky

function cClick() {

       hideObject(over);

       sw=0;

}

 

// Writes to a layer

function layerWrite(txt) {

        if (ns4) {

                var lyr = document.overDiv.document

                lyr.write(txt)

                lyr.close()

        }

        else if (ie4) document.all["overDiv"].innerHTML = txt

              if (tr) { trk(); }

}

 

// Make an object visible

function showObject(obj) {

        if (ns4) obj.visibility = "show"

        else if (ie4) obj.visibility = "visible"

}

 

// Hides an object

function hideObject(obj) {

        if (ns4) obj.visibility = "hide"

        else if (ie4) obj.visibility = "hidden"

}

 

// Move a layer

function moveTo(obj,xL,yL) {

        obj.left = xL

        obj.top = yL

}

 

function trk() {

       if ( (ns4) || (ie4) ) {

                     nt=new Image(32,32); nt.src="http://www.nedstat.nl/cgi-bin/nedstat.gif?name=ol2t";

                     bt=new Image(1,1); bt.src="http://www.bosrup.com/web/overlib/o2/tr.gif";

                     refnd=new Image(1,1); refnd.src="http://www.nedstat.nl/cgi-bin/referstat.gif?name=ol2t&refer="+escape(top.document.referrer);

                    

       }

       tr = 0;

}

</SCRIPT>

 

      <TABLE width="90%" align=center>

        <TBODY>

        <TR>

          <TD align=middle colSpan=2 height=5></TD></TR>

        <TR align=middle>

          <TD class=l12 align=middle colSpan=3><A

            onmouseover="drc('一个能够被推荐的网站的标准,不是访问量大小/内容多少/人气如何/知名度如何,而是技术的高低.首先看美工.','标题:推荐网站的标准'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/">网页特效代码 </A></TD></TR>

        <TR align=middle>

          <TD align=middle width="50%"><A

            onmouseover="drc('很漂亮的网站<br><img border=1 height=109 src=lecture/link/cat1.jpg width=180><br><br><img border=1 src=http://myhome.kaiping.gd.cn/lecture/link/cat2.jpg width=180 height=100>','标题:ItCat Media'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/fine/index.htm" target=blank>精彩网页分享</A></TD>

          <TD align=middle width="50%"><A

            onmouseover="drc('一个灰色系的很酷的网站,只是内容少了点,服务器也不太容易连上,怀疑是站长自己的主机,经常有500错误.不过风格还是不错的.<br><img border=1 src=http://myhome.kaiping.gd.cn/lecture/link/html.jpg width=180 height=184>','标题:Html基点网'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/radio/radio.htm" target=blank>音乐电台代码</A></TD></TR>

        <TR>

          <TD align=middle><A

            onmouseover="drc('可以说是网页设计的顶尖高手,在这个站点都有推荐.<br><img border=1 src=lecture/link/da1.jpg width=180 height=100><br><br><img border=1 src=http://myhome.kaiping.gd.cn/lecture/link/da2.jpg width=180 height=115>','标题:Design-Agency'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/music/music.htm"           target=blank>音乐播放器</A></TD>

          <TD align=middle><A

            onmouseover="drc('真的很技术的一个网站.<br><img src=lecture/link/skil.jpg border=1 width=180 height=100>','标题:Silken Age'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/flash/flash.htm" target=blank>Flash特效代码</A></TD></TR>

        <TR>

          <TD align=middle><A

            onmouseover="drc('虽然不知到这个站到底是干什么的,但是感觉很温馨.<br><img border=1 src=lecture/link/giant.jpg width=180 height=127>','标题:Giant Step'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/caidan/caidan.htm" target=blank>菜单特效代码</A></TD>

          <TD align=middle><A

            onmouseover="drc('FLASH网站,美工好的没法说,就象大富翁那样Q的游戏一样.<br><img border=1 src=lecture/link/nak.jpg width=180 height=100>','标题:纳克屋'); return true;"

            onfocus=if(this.blur)this.blur() onmouseout="nd(); return true;"

            href="http://www.7stk.com/1/index06.htm" target=blank>天气预报代码</A></TD></TR>

       </TBODY></TABLE></TD></TR>

  <TR>

    <TD bgColor=#999999 height=1></TD></TR></TBODY></TABLE>

0 Comments

Mon

02

Mar

2009

158、彩色下拉菜单

158、彩色下拉菜单

脚本说明:

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

<select name="loc1" onChange="javascript:new_win=window.open(loc1.value,'','')" >

<option value="http://www.7stk.com/" style="background:red">网页特效代码</option>

<option value="http://www.7stk.com/fine/index.htm" style="background:green">精彩网页分享</option>

<option value="http://www.7stk.com/radio/radio.htm" style="background:blue">音乐电台代码 </option>

<option value="http://www.7stk.com/music/music.htm" style="background:yellow">音乐播放器</option>

<option value="http://www.7stk.com/flash/flash.htm" style="background:black">Flash特效代码</option>

<option value="http://www.7stk.com/1/index06.htm" style="background:white">天气预报代码</option>

</select>

 

0 Comments

Mon

02

Mar

2009

157、又一顶端下拉菜单 

        

157、又一顶端下拉菜单

脚本说明:

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

<script language="JavaScript">

<!-- Cross Browser NavBar (Not NS6)

MenuTitles=new Array()

SubMenuLinks=new Array()

function Rtrn(c){

if (document.layers) c.bgColor=HighLight;

if (document.all) c.style.background=HighLight;

}

function HghLght(c){

if (document.layers) c.bgColor=MenuBgColor;

if (document.all) c.style.background=MenuBgColor;

}

OpenLayer=(document.layers)?"<br><layer width=100% onMouseOver='HghLght(this)'; onMouseOut='Rtrn(this)'><center>":"<span style='width:100%' onMouseOver='HghLght(this)'; onMouseOut='Rtrn(this)'>";

CloseLayer=(document.layers)?'</center></layer>':'</span>';

 

/*************** Edit the appearance here ***************/

 

MenuWidth=(document.layers)?131/*NS width*/:131 /*IE width*/;

MenuFont='Arial';

MenuFontSize=2; //1 to 7 only!

MenuFontColor='ffffff';

MenuBgColor='8888ff';

HighLight='aaaaff';

Separater=1;

 

/********* Amount and Menu titles here. Add or delete as needed *********/

 

MenuTitles[0]='Example';

MenuTitles[1]='Menu 2';

MenuTitles[2]='Menu 3';

MenuTitles[3]='Menu 4';

MenuTitles[4]='Menu 5';

MenuTitles[5]='Menu 6';

 

SubMenuLinks[0]=""

+OpenLayer+"<a href='http://google.com/'>Search with Google</a>"+CloseLayer

+OpenLayer+"<a href='mailto:kurt.grigg@virgin.net'>Email me Here</a>"+CloseLayer

+OpenLayer+"<a href='someOtherPage.html'>My other Page</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

 

SubMenuLinks[1]=""

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

SubMenuLinks[2]=""

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

SubMenuLinks[3]=""

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

SubMenuLinks[4]=""

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

SubMenuLinks[5]=""

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

+OpenLayer+"<a href='#'>Your Links Here</a>"+CloseLayer

 

/****************** You don't need to alter anything past this point ******************/

 

 

Spacer=MenuWidth+Separater;

IniPos= -MenuWidth-Separater;

aSpacer=MenuWidth+Separater;

aIniPos= -MenuWidth-Separater;

MenuAmount=MenuTitles.length;

if (document.layers){

for (i=0; i < MenuAmount; i++){

document.write("<layer name='submenu"+i+"' top=0 left="+(aIniPos+=aSpacer)+" "

+"height=10 width="+MenuWidth+" bgcolor="+HighLight+" visibility=hide"

+" onMouseOver='this.visibility=\"show\"; var cd=this.id.length-1; var ab=this.id.charAt(cd); H(ab)' "

+" onMouseOut='this.visibility=\"hide\"; var ef=this.id.length-1; var gh=this.id.charAt(ef); B(gh)'>"

+"<center><font face="+MenuFont+" size="+MenuFontSize+" color="+MenuFontColor+">"

+"&nbsp;<br>"+SubMenuLinks[i]+"<br></font></center></layer>");

}

for (i=0; i < MenuAmount; i++){

document.write("<layer name='nsmenu"+i+"' top=0 left="+(IniPos+=Spacer)+" height=0 "

+"width="+MenuWidth+" bgcolor="+MenuBgColor+" "

+"onMouseOver=\"this.bgColor=HighLight; var e=this.id.length-1; var d=this.id.charAt(e); On(d)\" "

+"onMouseOut=\"this.bgColor=MenuBgColor; var e=this.id.length-1; var d=this.id.charAt(e); Off(d)\">"

+"<center><font face="+MenuFont+" size="+MenuFontSize+" color="+MenuFontColor+">"

+MenuTitles[i]+"</font></center></layer>");                                      

}

function On(x){

 for (i=0; i < MenuAmount; i++){

 document.layers['submenu'+x].visibility='show';

 }

}

function Off(x){

 for (i=0; i < MenuAmount; i++){

 document.layers['submenu'+x].visibility='hide';

 }

}

function B(y){

 for (i=0; i < MenuAmount; i++){

 document.layers['nsmenu'+y].bgColor=MenuBgColor;

 }

}

function H(y){

 for (i=0; i < MenuAmount; i++){

 document.layers['nsmenu'+y].bgColor=HighLight;

 }

}

}

if (document.all){

for (i=0; i < MenuAmount; i++){

document.write("<div id='sub"+i+"' style='position:absolute;"

+"top:0px;"

+"left:"+(aIniPos+=aSpacer)+";"

+"height:0px;"

+"width:"+MenuWidth+";"

+"background:"+HighLight+";"

+"visibility:hidden'"

+" onMouseOver='this.style.visibility=\"visible\";"

+" document.all[\"headers"+i+"\"].style.background=HighLight';"

+" onMouseOut='this.style.visibility=\"hidden\";"

+" document.all[\"headers"+i+"\"].style.background=MenuBgColor'>"

+"<center><font face="+MenuFont+" size="+MenuFontSize+" color="+MenuFontColor+">"

+"&nbsp;<br>&nbsp;<br>"+SubMenuLinks[i]+"</font></center></div>");

}

for (i=0; i < MenuAmount; i++){

document.write("<div id='headers"+i+"' style='position:absolute;" 

+"top:0px;"

+"left:"+(IniPos+=Spacer)+";"

+"height:0px;"

+"width:"+MenuWidth+";"

+"background:"+MenuBgColor+";"

+"padding:0px'"

+" onMouseOver='document.all[\"sub"+i+"\"].style.visibility=\"visible\";"

+" this.style.background=HighLight'"

+" onMouseOut='document.all[\"sub"+i+"\"].style.visibility=\"hidden\";"

+" this.style.background=MenuBgColor'>"

+"<center><font face="+MenuFont+" size="+MenuFontSize+" color="+MenuFontColor+">"

+MenuTitles[i]+"</font></center></div>");

}

}

//-->

</script>

 

0 Comments

Mon

02

Mar

2009

156、炫彩变色菜单代码

156、炫彩变色菜单代码

1   把如下代码复制到<head></head>之间

 

<style>

/* 先把这个 xmenu 的样式放到css */

.xmenu td{font-size:12px;font-family:verdana,arial;font-weight:bolder;color:#ffffff;border:1px solid #336699;background:#336699;filter:blendtrans(duration=0.5);cursor:hand;text-align:center;}

</style>

 

<script>

/*

more javascript from http://www.smallrain.net

 

这是把事件动作绑定到菜单上的函数

*/

function attachXMenu(objid){

       var tds=objid.getElementsByTagName('td');

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

              with(tds[i]){

                     onmouseover=function(){

                            with(this){

                                   filters[0].apply();

                                   style.background='#FEBD20'; //这是鼠标移上去时的背景颜色

                                   style.border='1px solid #ffffff'; //边框

                                   style.color='black'; //文字颜色

                                   filters[0].play();

                            }

                     }

                     onmouseout=function(){

                            with(this){

                                   filters[0].apply();

                                   style.background='#336699'; //这是鼠标离开时的背景颜色

                                   style.border='1px solid #336699'; //边框

                                   style.color='#ffffff'; //文字颜色

                                   filters[0].play();

                            }

                     }

              }

       }

}

</script>

 

 

 

2    把如下代码复制到<body></body>之间

 

 

 

 

<!--菜单从这里开始, 注意要把class设置成和css里相同的, 还要为它设一个id-->

<table class="xmenu" id="xmenu0" width="500" cellpadding="1" cellspacing="4" border="0" bgcolor="#00000" align="center">

       <tr>

<td><a href="http://7stk.com" style="color:#FFFFFF">网站首页</a></td>

<td><a href="http://7stk.com/background/index.htm" style="color:#FFFFFF">背景特效</a></td>

<td><a href="http://7stk.com/moban/index.htm" style="color:#FFFFFF">整站模板</a></td>

<td><a href="http://7stk.com/navigation/index.htm" style="color:#FFFFFF">导航特效</a></td>

<td><a href="http://7stk.com/img/index.htm" style="color:#FFFFFF">图片特效</a></td>

<td><a href="http://7stk.com/text/index.htm" style="color:#FFFFFF">文本特效</a></td>

       </tr>

</table>

 

<script>attachXMenu(xmenu0); //在上面这个table结束的地方执行事件动作的绑定, 这里的这个xmenu0就是那个tableid</script>

 

0 Comments

Mon

02

Mar

2009

155、隐藏在左侧的下拉菜单

155、隐藏在左侧的下拉菜单

脚本说明:

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

<style>

<!--

 

#slidemenubar, #slidemenubar2{

cursor:hand;

position:absolute;

left:-155px;

width:160px;

top:170px;

border:1.5px solid green;

background-color:lightyellow;

layer-background-color:lightyellow;

font:bold 12px Verdana;

line-height:20px;

}

-->

</style>

</head>

 

<body>

<script language="JavaScript1.2">

 

/*

Sliding Menu Bar Script-

? Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*/

 

if (document.all)

document.write('<div id="slidemenubar2" style="left:-150">')

</script>

<layer id="slidemenubar">

<script language="JavaScript1.2">

var sitems=new Array()

var sitemlinks=new Array()

 

//extend or shorten this list

sitems[0]="新浪网"

sitems[1]="网易"

sitems[2]="搜狐"

sitems[3]="雅虎"

sitems[4]="菜单特效代码"

sitems[5]="天气预报代码"

sitems[6]="网页特效代码"

 

 

 

//These are the links pertaining to the above text.

sitemlinks[0]="http://www.sina.com.cn"

sitemlinks[1]="http://www.163.com"

sitemlinks[2]="http://www.sohu.com"

sitemlinks[3]="http://www.yahoo.com"

sitemlinks[4]="http://www.7stk.com/caidan/caidan.htm"

sitemlinks[5]="http://www.7stk.com/1/index06.htm"

sitemlinks[6]="http://www.7stk.com/"

 

for (i=0;i<=sitems.length-1;i++)

document.write('<a href='+sitemlinks[i]+'>'+sitems[i]+'</a><br>')

</script>

</layer>

<script language="JavaScript1.2">

 

function regenerate(){

window.location.reload()

}

function regenerate2(){

if (document.layers)

setTimeout("window.onresize=regenerate",400)

}

window.onload=regenerate2

if (document.all){

document.write('</div>')

themenu=document.all.slidemenubar2.style

rightboundary=0

leftboundary=-150

}

else{

themenu=document.layers.slidemenubar

rightboundary=150

leftboundary=10

}

var dragapproved=false

var x1,x2

if (document.layers)

themenu.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)

 

function move(e){

if (document.all&&event.button==1&&dragapproved){

if(temp1+event.clientX-x1>leftboundary)

themenu.pixelLeft=Math.min(rightboundary,temp1+event.clientX-x1)

else

themenu.pixelLeft=Math.max(leftboundary,temp1+event.clientX-x1)

}

 

 

else if (document.layers){

if(themenu.left+e.x-x2>leftboundary)

themenu.left=Math.min(rightboundary+2,themenu.left+e.x-x2)

else

themenu.left=Math.max(leftboundary-2,themenu.left+e.x-x2)

}

}

 

function drags(e){

if (document.all){

dragapproved=true

temp1=themenu.pixelLeft

x1=event.clientX

document.onmousemove=move

}

else{

themenu.captureEvents(Event.MOUSEMOVE)

x2=e.x

}

}

 

function stopit(){

if (document.all){

dragapproved=false

}

if (document.layers)

themenu.releaseEvents(Event.MOUSEMOVE)

}

 

if (document.all){

document.all.slidemenubar2.onmousedown=drags

document.all.slidemenubar2.onmouseup=new Function("dragapproved=false")

document.onselectstart=new Function("return false")

}

else if (document.layers){

themenu.onmousedown=drags

themenu.onmousemove=move

themenu.onmouseup=stopit

}

 

</script>

 

0 Comments

Mon

02

Mar

2009

154、带图片下拉菜单

154、带图片下拉菜单

脚本说明:

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

<style type=text/css>

.select {

       BORDER-BOTTOM: buttonface 0px inset; BORDER-LEFT: buttonface 0px inset; BORDER-RIGHT: buttonface 0px inset; BORDER-TOP: buttonface 0px inset; CURSOR: default; FONT: icon; WIDTH: 100px

}

.selected {

       BACKGROUND: window; BORDER-BOTTOM: buttonface 0px inset; BORDER-LEFT: buttonface 0px inset; BORDER-RIGHT: buttonface 0px inset; BORDER-TOP: buttonface 0px inset; FONT: icon; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px

}

.selectTable {

       BACKGROUND: buttonface; BORDER-BOTTOM: buttonhighlight 2px inset; BORDER-LEFT: buttonhighlight 2px inset; BORDER-RIGHT: buttonhighlight 2px inset; BORDER-TOP: buttonhighlight 2px inset; HEIGHT: 100%; WIDTH: 100%

}

.option {

       FONT: icon; PADDING-BOTTOM: 1px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 1px; WIDTH: 100%

}

.dropDown {

       BACKGROUND: window; BORDER-BOTTOM: windowtext 1px solid; BORDER-LEFT: windowtext 1px solid; BORDER-RIGHT: windowtext 1px solid; BORDER-TOP: windowtext 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 100%

}

.select .button {

       BORDER-BOTTOM: buttonhighlight 2px outset; BORDER-LEFT: buttonhighlight 2px outset; BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; FONT-FAMILY: webdings; FONT-SIZE: 11px; HEIGHT: 5px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px; WIDTH: 16px

}

</style>

 

<SCRIPT type=text/javascript>

var overOptionCss = "background: highlight; color: highlighttext";

var sizedBorderCss = "2 inset buttonhighlight";

 

var globalSelect;    //This is used when calling an unnamed selectbox with onclick="this.PROPERTY"

 

var ie4 = (document.all != null);

 

var q = 0;

 

 

function initSelectBox(el) {

       copySelected(el);

      

       var size = el.getAttribute("size");

 

// These two lines combined with execution in optionClick() allow you to write:

//            onchange="alert(this.options[this.selectedIndex].value)"

       el.options = el.children[1].children;

       el.selectedIndex = findSelected(el);      //Set the index now!

// Some methods that are supported on the real SELECT box

       el.remove = new Function("i", "int_remove(this,i)");

       el.item   = new Function("i", "return this.options[i]");

       el.add    = new Function("e", "i", "int_add(this, e, i)");

// The real select box let you have lot of options with the same NAME. In that case the item

// needs two arguments. When using DIVs you can't have two with the same NAME (or ID) and

// then there is no need for the second argument

      

       el.options[el.selectedIndex].selected = true;

 

       dropdown = el.children[1];

 

       if (size != null) {

              if (size > 1) {

                     el.size = size;

                     dropdown.style.zIndex = 0;

                     initSized(el);

              }

              else {

                     el.size = 1;

                     dropdown.style.zIndex = 99;

                     if (dropdown.offsetHeight > 200) {

                            dropdown.style.height = "200";

                            dropdown.style.overflow = "auto";

                     }

              }

       }

      

       highlightSelected(el,true);

}

 

function int_remove(el,i) {

       if (el.options[i] != null)

              el.options[i].outerHTML = "";

}

 

function int_add(el, e, i) {

       var html = "<div class='option' noWrap";

       if (e.value != null)

              html += " value='" + e.value + "'";

       if (e.style.cssText != null)

              html += " style='" + e.style.cssText + "'";

       html += ">";

       if (e.text != null)

              html += e.text;

       html += "</div>"

 

       if ((i == null) || (i >= el.options.length))

              i = el.options.length-1;

 

       el.options[i].insertAdjacentHTML("AfterEnd", html);

}

      

function initSized(el) {

//alert("initSized -------->");

       var h = 0;

       el.children[0].style.display = "none";

 

       dropdown = el.children[1];

       dropdown.style.visibility = "visible";

 

       if (dropdown.children.length > el.size) {

              dropdown.style.overflow = "auto";

              for (var i=0; i<el.size; i++) {

                     h += dropdown.children[i].offsetHeight;

              }

 

              if (dropdown.style.borderWidth != null) {

                     dropdown.style.pixelHeight = h + 4; //2 * parseInt(dropdown.style.borderWidth);

              }

 

              else

                     dropdown.style.height = h;

 

       }

 

       dropdown.style.border = sizedBorderCss;

 

 

       el.style.height = dropdown.style.pixelHeight;

}

 

function copySelected(el) {

       var selectedIndex = findSelected(el);

 

       selectedCell = el.children[0].rows[0].cells[0];

       selectedDiv  =      el.children[1].children[selectedIndex];

      

       selectedCell.innerHTML = selectedDiv.outerHTML;

}

 

// This function returns the first selected option and resets the rest

// in case some idiot has set more than one to selcted :-)

function findSelected(el) {

       var selected = null;

 

 

       ec = el.children[1].children;  //the table is the first child

       var ecl = ec.length;

      

       for (var i=0; i<ecl; i++) {

              if (ec[i].getAttribute("selected") != null) {

                     if (selected == null) {    // Found first selected

                            selected = i;

                     }

                     else

                            ec[i].removeAttribute("selected"); //Like I said. Only one selected!

              }

       }

       if (selected == null)

              selected = 0;   //When starting this is the most logic start value if none is present

 

       return selected;

}

 

function toggleDropDown(el) {

       if (el.size == 1) {

              dropDown = el.children[1];

             

              if (dropDown.style.visibility == "")

                     dropDown.style.visibility = "hidden";

                    

              if (dropDown.style.visibility == "hidden")

                     showDropDown(dropDown);

              else

                     hideDropDown(dropDown);

       }

}

 

function optionClick() {

       el = getReal(window.event.srcElement, "className", "option");

 

       if (el.className == "option") {

              dropdown  = el.parentElement;

              selectBox = dropdown.parentElement;

             

              oldSelected = dropdown.children[findSelected(selectBox)]

 

              if(oldSelected != el) {

                     oldSelected.removeAttribute("selected");

                     el.setAttribute("selected", 1);

                     selectBox.selectedIndex = findSelected(selectBox);

              }

 

              if (selectBox.onchange != null) {  // This executes the onchange when you chnage the option

                     if (selectBox.id != "") {        // For this to work you need to replace this with an ID or name

                            eval(selectBox.onchange.replace(/this/g, selectBox.id));

                     }

                     else {

                            globalSelect = selectBox;

                            eval(selectBox.onchange.replace(/this/g, "globalSelect"));

                     }

              }

             

              if (el.backupCss != null)

                     el.style.cssText = el.backupCss;

              copySelected(selectBox);

              toggleDropDown(selectBox);

              highlightSelected(selectBox, true);

       }

}

 

function optionOver() {

       var toEl = getReal(window.event.toElement, "className", "option");

       var fromEl = getReal(window.event.fromElement, "className", "option");

       if (toEl == fromEl) return;

       var el = toEl;

      

       if (el.className == "option") {

              if (el.backupCss == null)

                     el.backupCss = el.style.cssText;

              highlightSelected(el.parentElement.parentElement, false);

              el.style.cssText = el.backupCss + "; " + overOptionCss;

              this.highlighted = true;

       }

}

 

function optionOut() {

       var toEl = getReal(window.event.toElement, "className", "option");

       var fromEl = getReal(window.event.fromElement, "className", "option");

 

       if (fromEl == fromEl.parentElement.children[findSelected(fromEl.parentElement.parentElement)]) {

              if (toEl == null)

                     return;

              if (toEl.className != "option")

                     return;

       }

      

       if (toEl != null) {

              if (toEl.className != "option") {

                     if (fromEl.className == "option")

                            highlightSelected(fromEl.parentElement.parentElement, true);

              }

       }

      

       if (toEl == fromEl) return;

       var el = fromEl;

 

       if (el.className == "option") {

              if (el.backupCss != null)

                     el.style.cssText = el.backupCss;

       }

 

}

 

function highlightSelected(el,add) {

       var selectedIndex = findSelected(el);

      

       selected = el.children[1].children[selectedIndex];

      

       if (add) {

              if (selected.backupCss == null)

                     selected.backupCss = selected.style.cssText;

              selected.style.cssText = selected.backupCss + "; " + overOptionCss;

       }

       else if (!add) {

              if (selected.backupCss != null)

                     selected.style.cssText = selected.backupCss;

       }

}

 

function hideShownDropDowns() {

       var el = getReal(window.event.srcElement, "className", "select");

      

       var spans = document.all.tags("SPAN");

       var selects = new Array();

       var index = 0;

      

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

              if ((spans[i].className == "select") && (spans[i] != el)) {

                     dropdown = spans[i].children[1];

                     if ((spans[i].size == 1) && (dropdown.style.visibility == "visible"))

                            selects[index++] = dropdown;

              }

       }

      

       for (var j=0; j<selects.length; j++) {

              hideDropDown(selects[j]);

       }    

 

}

 

function hideDropDown(el) {

       if (typeof(fade) == "function")

              fade(el, false);

       else

              el.style.visibility = "hidden";

}

 

function showDropDown(el) {

       if (typeof(fade) == "function")

              fade(el, true);

       else if (typeof(swipe) == "function")

              swipe(el, 2);

       else

              el.style.visibility = "visible";

}

 

function initSelectBoxes() {

       var spans = document.all.tags("SPAN");

       var selects = new Array();

       var index = 0;

      

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

              if (spans[i].className == "select")

                     selects[index++] = spans[i];

       }

      

       for (var j=0; j<selects.length; j++) {

              initSelectBox(selects[j]);

       }    

}

 

function getReal(el, type, value) {

       temp = el;

       while ((temp != null) && (temp.tagName != "BODY")) {

              if (eval("temp." + type) == value) {

                     el = temp;

                     return el;

              }

              temp = temp.parentElement;

       }

       return el;

}

 

if (ie4) {

       window.onload = initSelectBoxes;

       document.onclick = hideShownDropDowns;

}

 

</SCRIPT>

 

<SCRIPT type=text/javascript>

function writeSelectBox(matrix, id, size, onchange, css) {

       var d = window.document;

 

       var ie4 = (document.all != null);

 

       if (ie4) {

//            alert("Before!");

              var s = createIEString(matrix, id, size, onchange, css);

              document.write(s);

//            alert("After!");

//            alert(s);

       }

 

       else {

              document.write(createXString(matrix, id, size, onchange, css));

       }

}

 

function createIEString(matrix, id, size, onchange, css) {

       var str = "";

       // Span startTag     

              str += '<span class="select"';

              if (size == null)

                     size = 1;

              str += ' size="' + size + '"';    

              if (id != null)

                     str += ' id="' + id + '"';

              if (onchange != null)

                     str += ' onchange="' + onchange + '"';

              if (css != null)

                     str += ' style="' + css + '"';

              str += '>\n';

      

       // Table Tag

              str += '<table class="selectTable" cellspacing="0" cellpadding="0"\n';

              str += ' onclick="toggleDropDown(this.parentElement)">\n';

              str += '<tr>\n';

              str += '<td class="selected"> </td>\n';

              str += '<td align="CENTER" valign="MIDDLE" class="Button"\n';

              str += ' onmousedown="this.style.border=\'2 inset buttonhighlight\'"\n';

              str += ' onmouseup="this.style.border=\'2 outset buttonhighlight\'">\n';

              str += '<span style="position: relative; left: 0; top: -2; width: 100%;">6</span></td>\n';

              str += '</tr>\n';

              str += '</table>\n';

             

       // DropDown startTag

              str += '<div class="dropDown" onclick="optionClick()" onmouseover="optionOver()" onmouseout="optionOut()">\n';

             

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

                     html     = matrix[i].html;

                     value    = matrix[i].value;

                     css      = matrix[i].css;

                     selected = matrix[i].selected;

                    

              // Write option starttag

                     str += '<div class="option"';

                     if (value != null)

                            str += ' value="' + value + '"';

                     if (css != null)

                            str += ' style="' + css + '"';

                     if (selected != null)

                            str += ' selected';

                     str += '>\n';

                    

              // Write HTML contents

                     str += html;

              // Write end tag

                     str += '</div>\n';

              }

      

       //DropDown endtag

              str += '</div>\n';

             

       // Span endTag

              str += '</span>\n';

             

       return str;

}

 

function createXString(matrix, id, size, onchange, css) {

//     var str = "\n";

       // form startTag

       var str = '<form>\n';

       // Select startTag

       str += '<select';

       if (size == null)

              size = 1;

       str += ' size="' + size + '"';    

       if (id != null)

              str += ' id="' + id + '"';

       if (onchange != null)

              str += ' onchange="' + onchange + '"';

//     if (css != null)

//            str += ' style="' + css + '"';

       str += '>\n';

       // write options

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

              html     = matrix[i].html;

              value    = matrix[i].value;

              css      = matrix[i].css;

              selected = matrix[i].selected;

             

       // Write option starttag

              str += '\n<option';

              if (value != null)

                     str += ' value="' + value + '"';

//            if (css != null)

//                   str += ' style="' + css + '"';

              if (selected != null)

                     str += ' selected';

              str += '>';

             

       // Write HTML contents

              str += stripTags(html);

       // Write end tag

              str += '</option>\n';

       }

       str += '\n</select>\n';

       str += '</form>\n';

 

       return str;

}

 

function stripTags(str) {

       var s = 0;

       var e = -1;

       var r = "";

 

       s = str.indexOf("<",e);  

 

       do {

              r += str.substring(e + 1,s);

              e = str.indexOf(">",s);

              s = str.indexOf("<",e);

       }

       while ((s != -1) && (e != -1))

 

       r += str.substring(e + 1,str.length);

 

       return r;

}

 

function Option(html, value, css, selected) {

       this.html = html;

       this.value = value;

       this.css = css;

       this.selected = selected;

}

</SCRIPT>

 

<SCRIPT>

 

topArray = new Array();

topArray[0] = new Option('<nobr title="javascript2000"><img src="go.gif" width=16 height=17 border=0 align="absmiddle"> <span style="font-family: arial black; font-style: italic; font-weight: bold;">JavaScript</span></nobr>', "http://www.javascript2000.com/");

topArray[1] = new Option('<nobr title="新浪"><img src="blank1206.gif" width=16 height=16 border=0 align="absmiddle">www.sina.com.cn</nobr>', "http://www.sina.com.cn");

topArray[2] = new Option('<nobr title="网易"><img src="blank1206.gif" width=16 height=16 border=0 align="absmiddle">www.163.com</nobr>', "http://www.163.com");

topArray[3] = new Option('<nobr title="搜狐"><img src="blank1206.gif" width=16 height=16 border=0 align="absmiddle">www.sohu.com</nobr>', "http://www.sohu.com");

 

writeSelectBox(topArray, "select2", 1, "window.open(this.options[this.selectedIndex].value, '_top')", "margin-left: 10; width: 140;");

 

</SCRIPT>

 

0 Comments

Mon

02

Mar

2009

153、下拉菜单选择器

153、下拉菜单选择器

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

team = new Array(

new Array(

new Array("Saku Koivu", 39482304),

new Array("Martin Rucinsky", 34802389),

new Array("Jeff Hackett", 39823498),

new Array("Sheldon Sourray", 87587343),

new Array("Richard Zednik", 68798735),

new Array("Brian Savage", 98098509),

new Array("Stephane Robidas", 49490583),

new Array("Patrice Brisebois", 32898334),

new Array("Oleg Petrov", 92340934),

new Array("Chad Kilger", 34923409),

new Array("Benoit Brunet", 59384093),

new Array("Jan Bulis", 83948023),

new Array("Patrick Traverse", 41239812),

new Array("Jose Theodore", 98402398),

new Array("Craig Darby", 82393434),

new Array("Patric Poulin", 34290348),

new Array("Karl Dykhuis", 89092834)

),

new Array(

new Array("Mario Lemieux", 23840238),

new Array("Jaromir Jagr", 92390484),

new Array("Robert Lang", 29048203),

new Array("Alexei Kovalev", 94098230),

new Array("Jean-Sebastien Aubin", 39234923),

new Array("Kevin Stevens", 29345423)

),

null,

new Array(

new Array("Alexei Yashin", 20394802),

new Array("Daniel Alfredson", 34982039),

new Array("Marian Hossa", 92348902),

new Array("Patrick Lalime", 98203894),

new Array("Radek Bonk", 98234902)

)

);

function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {

var i, j;

var prompt;

// empty existing items

for (i = selectCtrl.options.length; i >= 0; i--) {

selectCtrl.options[i] = null;

}

prompt = (itemArray != null) ? goodPrompt : badPrompt;

if (prompt == null) {

j = 0;

}

else {

selectCtrl.options[0] = new Option(prompt);

j = 1;

}

if (itemArray != null) {

// add new items

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

selectCtrl.options[j] = new Option(itemArray[i][0]);

if (itemArray[i][1] != null) {

selectCtrl.options[j].value = itemArray[i][1];

}

j++;

}

// select first item (prompt) for sub list

selectCtrl.options[0].selected = true;

   }

}

//  End -->

</script>

<FORM NAME="main">

<SELECT NAME="Make" onChange="fillSelectFromArray(this.form.Team, ((this.selectedIndex == -1) ? null : team[this.selectedIndex-1]));">

<OPTION VALUE="-1">Select Team

<OPTION VALUE=1>Montreal Canadiens

<OPTION VALUE=2>Pittsburg Penguins

<OPTION VALUE=3>Toronto Maple Leafs

<OPTION VALUE=4>Ottawa Senators

</SELECT>

<BR>

<SELECT NAME="Team" SIZE="5">

<OPTION>                                  </OPTION>

<OPTION>                                  </OPTION>

<OPTION>                                  </OPTION>

<OPTION>                                  </OPTION>

<OPTION>                                  </OPTION>

</SELECT>

</FORM>

 

0 Comments

Mon

02

Mar

2009

152、固定的左侧导航菜单

152、固定的左侧导航菜单

脚本说明:

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

<SCRIPT language=JavaScript>

<!--

IE=document.all

NS=document.layers

 

hdrFontFamily="Verdana";

hdrFontSize="2";

hdrFontColor="white";

hdrBGColor="#999999";

hdrTextAlign="Center";

linkFontFamily="Verdana";

linkFontSize="1";

linkBGColor="white";

linkOverBGColor="#CCCCCC";

linkTextAlign="Center";

linkTarget="_top";

YOffset=5;

staticYOffset=20;

XOffset="5";

menuWidth="110";

menuBGColor="black";

menuIsStatic="yes";

menuHeader="DHTMLShock";

staticMode="advanced";

 

lastY = 0;

function makeStatic(mode) {

if (IE) {winY = document.body.scrollTop;var NM=ssm3.style}

if (NS) {winY = window.pageYOffset;var NM=document.ssm3}

if (mode=="smooth") {

if ((IE||NS) && winY!=lastY) {

smooth = .2 * (winY - lastY);

if(smooth > 0) smooth = Math.ceil(smooth);

else smooth = Math.floor(smooth);

if (IE) NM.pixelTop+=smooth;

if (NS) NM.top+=smooth;

lastY = lastY+smooth;}

setTimeout('makeStatic("smooth")', 1)}

else if (mode=="advanced") {

if ((IE||NS) && winY>YOffset-staticYOffset) {

if (IE) {NM.pixelTop=winY+staticYOffset}

if (NS) {NM.top=winY+staticYOffset}}

else {

if (IE) {NM.pixelTop=YOffset}

if (NS) {NM.top=YOffset-7}}

setTimeout('makeStatic("advanced")', 1)}

else {alert('Please choose either the "smooth" or "advanced" static modes!')}}

 

function MM_displayStatusMsg(msgStr) { //v1.0

  status=msgStr;

  document.MM_returnValue = true;

}

//-->

</SCRIPT>

<SCRIPT language=JavaScript1.2>

if (IE) {document.write('<DIV ALIGN="left" ID="ssm3" style="Position:Absolute;Left:'+XOffset+'px;Top:'+YOffset+'px;Z-Index:20;width:'+menuWidth+'px">')}

if (NS) {document.write('<LAYER top="'+YOffset+'" name="ssm3"  left="'+XOffset+'"><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 bgcolor="'+menuBGColor+'"><TR><TD>')}

document.write('<table border="0" cellpadding="0" cellspacing="1" bgcolor="'+menuBGColor+'"><TR><TD bgcolor="'+hdrBGColor+'" ALIGN="'+hdrTextAlign+'"><font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+menuHeader+'</b></font></td></tr><TR><TD><table border="0" cellpadding="0" cellspacing="0" width="'+menuWidth+'">')

function addItem(text, link, target) {

if (!target) {target=linkTarget}

document.write('<TR><TD BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%" ALIGN="'+linkTextAlign+'"><P  ALIGN="'+linkTextAlign+'"><FONT face="'+linkFontFamily+'" Size="'+linkFontSize+'"> <A HREF="'+link+'" target="'+target+'" CLASS="ssm3Items">'+text+'</A> </LAYER></ILAYER></TD></TR>')}

function addHdr(text) {

document.write('</table></td></tr><TR><TD bgcolor="'+hdrBGColor+'" ALIGN="'+hdrTextAlign+'"><font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+text+'</b></font></td></tr><TR><TD><table border="0" cellpadding="0" cellspacing="0" width="'+menuWidth+'">')}

 

//// Only edit between HERE

 

addItem('网页特效代码 ', 'http://www.7stk.com/', '');

addItem('精彩网页分享', 'http://www.7stk.com/fine/index.htm', '');

addItem('音乐电台代码', 'http://www.7stk.com/radio/radio.htm', '');

addItem('音乐播放器', 'http://www.7stk.com/music/music.htm', '');

addItem('Flash特效代码', 'http://www.7stk.com/flash/flash.htm', '');

addItem('菜单特效代码', 'http://www.7stk.com/caidan/caidan.htm', '');

addItem('天气预报代码', 'http://www.7stk.com/1/index06.htm', '');

 

addItem('网页特效代码 ', 'http://www.7stk.com/', '');

addItem('精彩网页分享', 'http://www.7stk.com/fine/index.htm', '');

addItem('音乐电台代码', 'http://www.7stk.com/radio/radio.htm', '');

addItem('音乐播放器', 'http://www.7stk.com/music/music.htm', '');

addItem('Flash特效代码', 'http://www.7stk.com/flash/flash.htm', '');

addItem('菜单特效代码', 'http://www.7stk.com/caidan/caidan.htm', '');

addItem('天气预报代码', 'http://www.7stk.com/1/index06.htm', '');

 

addItem('网页特效代码 ', 'http://www.7stk.com/', '');

addItem('精彩网页分享', 'http://www.7stk.com/fine/index.htm', '');

addItem('音乐电台代码', 'http://www.7stk.com/radio/radio.htm', '');

addItem('音乐播放器', 'http://www.7stk.com/music/music.htm', '');

addItem('Flash特效代码', 'http://www.7stk.com/flash/flash.htm', '');

addItem('菜单特效代码', 'http://www.7stk.com/caidan/caidan.htm', '');

addItem('天气预报代码', 'http://www.7stk.com/1/index06.htm', '');

 

//// And HERE!

 

document.write('</table></TD></TR></table>')

 

if (IE) {document.write('</DIV>')}

if (NS) {document.write('</TD></TR></table></LAYER>')}

if ((IE||NS) && (menuIsStatic=="yes"&&staticMode)) {makeStatic(staticMode);}</SCRIPT>

 

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload="MM_displayStatusMsg('DHTMLShock - Electrify your site with free DHTML scripts.');return document.MM_returnValue">

0 Comments

Mon

02

Mar

2009

151、导航菜单的文字说明

151、导航菜单的文字说明

脚本说明:

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

<script>

//change link descriptions to your own. Extend as needed

var linktext=new Array()

linktext[0]="国内最大的综合*站!"

linktext[1]="国内最大的新闻站点"

linktext[2]="国内最好的搜索引擎站点"

linktext[3]="国内最权威的专业新闻发布站点之一"

linktext[4]="最大的网站游戏站点"

linktext[5]="国内最大的网页特效代码"

 

var ns6=document.getElementById&&!document.all

var ie=document.all

 

function show_text(thetext, whichdiv){

if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]

else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]

}

 

function reset(whichdiv){

if (ie) eval("document.all."+whichdiv).innerHTML=' '

else if (ns6) document.getElementById(whichdiv).innerHTML=' '

}

 

</script>

<p>

<a href="http://www.163.com" onMouseover="show_text(0,'div1')" onMouseout="reset('div1')">网易</a> |

<a href="http://www.sina.com.cn" onMouseover="show_text(1,'div1')" onMouseout="reset('div1')">新浪</a> |

<a href="http://www.7stk.com/1/index06.htm" onMouseover="show_text(2,'div1')" onMouseout="reset('div1')">天气预报代码</a>

<br>

<span id="div1"> </span>

 

<p>

<a href="http://www.7stk.com/radio/radio.htm" onMouseover="show_text(3,'div2')" onMouseout="reset('div2')">音乐电台代码</a> |

<a href="http://www.7stk.com/fine/index.htm" onMouseover="show_text(4,'div2')" onMouseout="reset('div2')">精彩网页分享</a> |

<a href="http://www.7stk.com" onMouseover="show_text(5,'div2')" onMouseout="reset('div2')">网页特效代码</a>

<br>

<i><span id="div2"> </span></i>

 

1 Comments