JavaScript 10 Nifty Tricks |
|||||||||||
|
|
Featuring:
A grab bag of JavaScripting tricks var width; var height; width=700; height=360; <script languuage="javascript"> resizeTo(width,height); </script >Or equivalently add the following code to the onload= in your <body> tag: <body onload="resizeTo(700, 360);" > which is what we are doing. 2)Need to change the background color on entry and exit from a link - Hover the mouse over this Text then remove it This is the code required: <a href="#" onMouseOut="document.bgColor='cccccc'" onMouseOver="document.bgColor='red'".>Hover the mouse ...</a> So you can probably guess what code is at work in this block of text. Yep we have used a <span> with onMouseOut, and onMouseOver. 3)Want to change the background image for your page ? So guess what we did here? Yep added a <span> with onMouseOver and onMouseOut The critical code is: onMouseOut="document.body.background='page1.gif'" 4)Here is how to highlight rows of a table:
Notice that the TD tag overrides the TR color choice. 8)How to use textarea to contain coding outside a form 9)How to change an image onMouseOver and back onMouseOut |