Hi,
I have a js file and a html document.
I have made a function which generates a menu onclick
Now I want to put the text which has to appear in that menu in my js-document.
How can I do so (by using document write ?)
Thanx in advance
J
//Start js
var isNS=(document.layers);
if(isNS)document.captureEvents(Event.mousemove);
document.onmousemove=track;
function track(e)
{
var x=(isNS)?e.pageX:event.x;
var y=(isNS)?e.pageY:event.y;
if(isNS)document.captureEvents(Event.onclick);
isvis(x,y);
}
function isvis(x,y) {
if(isNS) {
if(document.quicktour.visibility!="hide" {
if(x<0||x>220||y<0||y>300)document.quicktour.visibility="hide";
}
} else if(quicktour.style.visibility!="hidden" {
if(x<0||x>220||y<0||y>300)quicktour.style.visibility="hidden";
}
}
function menu(x,n) {
if (x==1) {
if(isNS) {document.quicktour.visibility=(n!=0)?"visible":"hidden";
} else quicktour.style.visibility=(n!=0)?"visible":"hidden";
}
}
//??????????????
function writeQT()
{
document.write ('<b><u>QUICK TOUR</u></b> <br><p><b><u>blablabla</u></b>')
}
//??????????????
//End js
<html>
<head>
<style type="text/css">
.test {position:absolute;top:200;left:60;width:160;height:106;}
.menudiv {position:absolute;top:200;left:60;width:160;height:106;background-color:#cccccc;border:solid;border-width:1;border-color:#000000;z-index:10;visibility:hidden;}
</style>
<script language="JavaScript1.2" src="quicktour.js">
</script>
</head>
<body>
<div class="test"><a href="#" onclick="menu(1,1)">test</A></div>
<div id="quicktour" class="menudiv">
<center>
<b>here must come the text from the function writeQT
</b>
</center>
</div>
</body>
</html>
I have a js file and a html document.
I have made a function which generates a menu onclick
Now I want to put the text which has to appear in that menu in my js-document.
How can I do so (by using document write ?)
Thanx in advance
J
//Start js
var isNS=(document.layers);
if(isNS)document.captureEvents(Event.mousemove);
document.onmousemove=track;
function track(e)
{
var x=(isNS)?e.pageX:event.x;
var y=(isNS)?e.pageY:event.y;
if(isNS)document.captureEvents(Event.onclick);
isvis(x,y);
}
function isvis(x,y) {
if(isNS) {
if(document.quicktour.visibility!="hide" {
if(x<0||x>220||y<0||y>300)document.quicktour.visibility="hide";
}
} else if(quicktour.style.visibility!="hidden" {
if(x<0||x>220||y<0||y>300)quicktour.style.visibility="hidden";
}
}
function menu(x,n) {
if (x==1) {
if(isNS) {document.quicktour.visibility=(n!=0)?"visible":"hidden";
} else quicktour.style.visibility=(n!=0)?"visible":"hidden";
}
}
//??????????????
function writeQT()
{
document.write ('<b><u>QUICK TOUR</u></b> <br><p><b><u>blablabla</u></b>')
}
//??????????????
//End js
<html>
<head>
<style type="text/css">
.test {position:absolute;top:200;left:60;width:160;height:106;}
.menudiv {position:absolute;top:200;left:60;width:160;height:106;background-color:#cccccc;border:solid;border-width:1;border-color:#000000;z-index:10;visibility:hidden;}
</style>
<script language="JavaScript1.2" src="quicktour.js">
</script>
</head>
<body>
<div class="test"><a href="#" onclick="menu(1,1)">test</A></div>
<div id="quicktour" class="menudiv">
<center>
<b>here must come the text from the function writeQT
</b>
</center>
</div>
</body>
</html>