dom/tests/js/class.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 <HTML>
michael@0 2 <HEAD>
michael@0 3 <STYLE>
michael@0 4 .first { display: inline; color: green; }
michael@0 5 .second { display: block; color: red; }
michael@0 6 </STYLE>
michael@0 7 <SCRIPT>
michael@0 8 var className = "first";
michael@0 9 function toggleClass() {
michael@0 10 var node = document.getElementById("foo");
michael@0 11 if (className == "first") {
michael@0 12 className = "second";
michael@0 13 }
michael@0 14 else {
michael@0 15 className = "first";
michael@0 16 }
michael@0 17 node.className = className;
michael@0 18 }
michael@0 19 </SCRIPT>
michael@0 20 </HEAD>
michael@0 21 <BODY>
michael@0 22 <H1>Changing CLASS test</H1>
michael@0 23 <P>Clicking on the button that follows this paragraph
michael@0 24 should change the layout of <SPAN ID="foo" CLASS="first">these words</SPAN>
michael@0 25 with respect to the rest of the flow.</P>
michael@0 26 <FORM>
michael@0 27 <INPUT TYPE="button" VALUE="Toggle class" onClick="toggleClass(); return true;">
michael@0 28 </FORM>
michael@0 29 </BODY>
michael@0 30 </HTML>

mercurial