Forum Moderators: open

Message Too Old, No Replies

Events in overlapping span and div

Is there a solution

         

axel13

12:33 pm on Mar 18, 2004 (gmt 0)



Problem: show line numbers in status bar

Some sample code to explain the problem:

// note the textarea is no <textarea>, it just a varname!
<html><head>
<script language="javascript">

function printInStatusBar( textareaId, lineNumber ) {
message = " Textarea: " + textareaId + " Zeilennummer: " + lineNumber;
self.status = message;
return true;
}
function showInfo() {
return true;
}

</script>

<body>
<span onmouseover='javascript:printInStatusBar( 1, 1);'>Hallo Welt Zeile 1</span><br>
<br>
<span onmouseover='javascript:printInStatusBar( 1, 2);'>Hallo <div onmouseover='javascript:showInfo("t-1");' id="text-1-1" style="display: inline;"> Constat inter omnes, inde a <sym-h>detecto per <a href="asdasdf.htm" onmouseover="javascript: return true;">Torricel</a> Welt Zeile 2</span><br>
<br>
<span onmouseover='javascript:printInStatusBar( 1, 3);'>Hallo</sym-h> Welt</div> <a href="#" onmouseover="javascript: return true;">Zeile</a> 3</span><br>
<br>
</body>
</html>

This code should just show the line number. The real challenge is the overlapping div

<span1 onmouseover=line1()> <div> </span1> <span2 onmouseover="line(2)"> </div> </span2>

Is there a solution to get the mouseover-event in span2?
Should I close the div before I close a span with the linenumber function?

Or is there another way to show the linenumber?

Rambo Tribble

1:57 pm on Mar 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm afraid I don't have time to address all of your questions, but let me point out that it is illegal to have overlapping HTML tags. Your page would not validate and browsers could throw fits.