Jump to content

Menu help


The Sea King

Recommended Posts

I need some help in making (HTML) context show in a specific place when I click the mouse.http://www.w3schools.com/html/tryit.asp?fi...e=tryhtml_basic

<html><head><meta name="author"content="The Sea King"><meta name="revised"content="The Sea King,November 9, 2007"><meta name="generator"content="Notepad"><meta name="description"content="Video Player is a player of fun, funny, cool, and legal videos"><title>Video Player</title></head><body background="http://img80.imageshack.us/img80/7098/lwbackgroundpz4.jpg"><style type="text/css">table, td {border-collapse: collapse;}a:link {color: #ffffff; text-decoration: none; font-style: italic;}a:visited {color: #ffffff; text-decoration: font-style: italic;}a:hover {text-decoration: underline;}</style><table border="1"><tr><td width="600" height="30" background="http://img443.imageshack.us/img443/7934/topeg4.jpg"> </td></tr></table><table border="1"><tr><td valign="top" width="100" height="400" background="http://img216.imageshack.us/img216/2637/menubackot8.jpg">News<br>Member Videos<br><<Other>><br><br>Lego<br>Fantasty<br>Other</td><td width="20" height="400" background="http://img112.imageshack.us/img112/2989/lwrightgg0.png"> </td><td width="474" height="400" align="center" background="http://img267.imageshack.us/img267/3472/lwcontextxl3.jpg"> VIDEOS GO HERE</td></tr></table><table border="1"><tr><td align="center" width="600" height="20" background="http://img113.imageshack.us/img113/4351/buttomzr1.jpg"> </td></tr></table><center><span style=font-size:8pt>Video Player © 2007-2008<br>Videos belong to their makers.</span></center></body></html>
Link to comment
Share on other sites

The easiest way I see is to just the innerHTML property of the HTML DOM. Firstly, decide what it is you want to click that will trigger this action. If it's just a mouseclick in general you could put it in onmousedown event inside of the <body> tag. If not then you'd need to put an onmousedown event on the specific element you want to change. This can be done as to add content dynamically if you had an empty element such as a div that you could specifically use to change. You could use something like this to change this as the onmousedown event.

function show_text(doc_id) {document.getElementById(doc_id).innerHTML = /* whatever you need here */;}

<p>Some elements</p><p>More Stuff</p><p id="changeme" onmousedown="show_text('changeme')">This text changes</p>

Whatever element you set the onmousedown to will be changed, provided you have the proper id property going into the function.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...