รบกวน ช่วยหน่อย... ปัญหา link คือว่า เขียน Javascript แบ่งเป็น เฟรม อ่ะ แล้ว ทำ เมนู ฝั่ง ซ้ายมือ แล้วให้แสดงผลฝั่งขวามือ
คือว่า เขียน Javascript แบ่งเป็น เฟรม อ่ะ แล้ว ทำ เมนู ฝั่ง ซ้ายมือ แล้วให้แสดงผลฝั่งขวามือ แต่ว่า เมื่อคลิก แล้วไม่ยอมแสดงผลเลย คือว่า โค๊ดก็คือ
<html>
<head>
<style>
.menu
{
position:relative;
background-color:#FFCCFF;
border:1px solid darkblue;
width:150;
font-size:8px;
font-family:Ms Sans Serif;
font:none;
position:absolute;
cursor:hand;
}
.item_panel
{
width:150;
border-left:1px solid darkblue;
border-right:1px solid darkblue;
clip:rect(0,150,0,0);
position:absolute;
}
.item_panel a
{
text-decoration:none;
color:black;
cursor:hand;
}
.item
{
background-color:White;
width:148;
font-size:8px;
font-family:Ms Sans Serif;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>Untitled Document</title>
</head>
<body>
<p>
<script language="JavaScript">
var height = 20; // height of the menu headers
var iheight = 15; // height of the menu_items
var bgc = "white" // background color of the item
var tc = "black" // text color of the item
var over_bgc = "9999ff";
var over_tc = "red";
var speed = 0;
var timerID = "";
var N = (document.all) ? 0 : 1;
var width = 152
var self_menu = new Array();
function write_menu()
{
smc = 0; // count the position of the self_menu
document.write("<div style='position:absolute'>");
mn = 0;
mni = 1;
start = -1;
for(i=0;i<Link.length;i++)
{
la = Link.split("|");
if (la[0] == "0")
{
if(start == 0)
{
document.write("</div>");
h = csmc * iheight;
tmn = mn; //-h
self_menu[smc] = new Array(tmn,h,0,-2);
smc++;
mn--;
}
csmc = 0;
document.write("<div class='menu' style='top:"+mn+";height:"+height+"' id='down"+smc+"' onclick='pull_down("+smc+","+mni+")'> "+ la[1] + "</div>");
self_menu[smc] = new Array(mn,height,0,mni);
smc++;
mni++;
mn+=height;
start = 1;
}
else
{
if(start == 1)
{
if(N)mn+=2;
document.write("<div class='item_panel' id='down"+smc+"' style='top:"+mn+"'>");
start = 0;
}
document.write("<a href='"+la[2]+"'");
if (la[3] != "") document.write(" target='" + la[3] + "' ");
document.write("><div class='item' id='d"+i+"' style='height:"+iheight);
if (N) document.write(";width:150");
document.write("' onmouseover='color(this.id)' onmouseout='uncolor(this.id)'> "+ la[1] + "</div></a>");
csmc++;
}
}
if (start == 0)
{
document.write("</div>");
h = csmc * iheight;
tmn = mn + 5; //-h
self_menu[smc] = new Array(tmn,h,0);
name = "down" + (self_menu.length-1);
obj = document.getElementById(name);
obj.style.borderBottomColor = "darkblue";
obj.style.borderBottomWidth = 1;
obj.style.borderBottomStyle = "solid";
}
document.write("</div>");
}
function color(obj)
{
document.getElementById(obj).style.backgroundColor = over_bgc;
document.getElementById(obj).style.color = over_tc
}
function uncolor(obj)
{
document.getElementById(obj).style.backgroundColor = bgc;
document.getElementById(obj).style.color = tc
}
function pull_down(nr,c)
{
if (timerID == "")
{
to = self_menu[nr+1][1]
begin = nr + 2;
if (timerID != "") clearTimeout(timerID);
if (self_menu[nr+1][2] == 0)
{
self_menu[nr+1][2] = 1;
if(nr == self_menu.length-2) {to++;}
epull_down(begin,to,0);
}
else
{
to = 0;
self_menu[nr+1][2] = 0;
name = "down"+(nr+2);
open_item = 0;
for(i=0;i<nr;i++)
{
if(self_menu[2] == 1)
{open_item += self_menu[1];
}
}
if (N == false) {open_item-= (c*1)};
if (nr== self_menu.length-2) {val = self_menu[self_menu.length-1][1];to=-1;}
else val = parseInt(document.getElementById(name).style.top) -(open_item)-(c*height);
epull_up(begin,to,val);
}
}
}
function epull_down(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip = "rect(0,"+width+","+(nowv+1)+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top = parseInt(obj.style.top)+1;
}
nowv++;
if(nowv < to) timerID = setTimeout("epull_down("+nr+","+to+","+nowv+")",speed);
else timerID = "";
}
function epull_up(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip = "rect(0,"+width+","+nowv+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top = parseInt(obj.style.top)-1;
}
nowv--;
if(nowv > to) timerID = setTimeout("epull_up("+nr+","+to+","+nowv+")",speed);
else timerID = "";
}
function startup(nr)
{
write_menu();
if (nr != 0)
{
for(i=0;i<self_menu.length;i++)
{
if(self_menu[3] == nr) pull_down(i,nr)
i==self_menu.length;
}
}
}
</script>
<img src="1145508260.jpg" width="156" height="98"><br>
<BR>
<script language="JavaScript">
//Link[nr] = "position [0 is menu/1 is item],Link name,url,target (blank|top|frame_name)"
var Link = new Array();
Link[0] = "0|-Street";
Link[1] = "1|Top|default.asp|topFreme";
Link[2] = "1|Bottom|suggest.html|mainframe";
Link[3] = "1|dress|http://www.geocities.com/namkiatv/reporterror/index.htm|";
Link[4] = "0|-Glam";
Link[5] = "1|Top|http://www.geocities.com/namkiatv/download/downloadicon|";
Link[6] = "1|Bottom|http://www.geocities.com/namkiatv/download/downloadmidi|";
Link[7] = "1|dress|http://www.geocities.com/namkiatv/tip/tipscomputer/index.htm|";
Link[8] = "0|-Work";
Link[9] = "1|Top|http://www.geocities.com/namkiatv/tip/submittip/index.htm|";
Link[10] = "1|Bottom|http://www.geocities.com/namkiatv/tip/tipsgames/index.htm|mainframe";
Link[11] = "1|dress|http://www.geocities.com/namkiatv/tip/tipsprogram/index.htm|";
Link[12] = "0|-Essential";
Link[13] = "1|Top|http://www.geocities.com/namkiatv/tip/submittip/index.htm|";
Link[14] = "1|Bottom|http://www.geocities.com/namkiatv/tip/tipsgames/index.htm|";
Link[15] = "1|dress|http://www.geocities.com/namkiatv/tip/tipsprogram/index.htm|";
startup(10); //0 to see no default items
</script>
</p>
<p> </p>
</body>
</html>
ทำอย่างไรให้แสดงผล ฝั่ง เฟรม ขวามือ พอใส่โค๊ด html ก็เออ เร่อ
รบกวน หน่อย
Tag : - - - -
Date :
22 เม.ย. 2549 10:00:31
By :
krapao
View :
2237
Reply :
0
Load balance : Server 03