【正文】
javascript: Table12 event handlers that exist in javascript onfocus onblur onselect onchange onsubmit onclick onmouseover onmouseout onload onunload onabort onerror onreset onkeypress onkeyup onmousedown onmousemove onmouseup onmove onresize POPUP MENUS PopUp Menus can be quickly created by using the select tag as it was used in forms to create a drop down list. Set the value of each of the options in the select tag to the url of the new page to be displayed. Use the onchange event handler to set the location of the window to the selected value in the drop down list. For example, if the form is named myform, the select tag is named mychoices, and the value of each option is a url then the sta tement = will take you to the new page that was selected from the drop down list. By default only one item in a list is displayed by a select statement until the viewer clicks on the down arrow to expose the rest of the list. To display more that one item at a time (and create a text box with a vertical scrollbar) include the size attribute in the select tag. For example, size=5 will display the first five items in the list and add a vertical scroll bar to the box if there are more than 5 items in the list. MOUSEOVERS A mouseover refers to the effect that occurs when the properties of an object are changed 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 5 if the mouse is positioned over the top of the object and then again if the mouse is removed from the object. The quickest way to generate a mouseover is to use the onmouseover and onmouseout event handlers in a form of inline style. Visit the style section of the DHTML page of this web site to see an example of mouseovers used with text as an inline style. Any style property that applies to a particular object can be changed as the result of a mouseover. Performing mouseovers with a graphic is not much different than with text. When the desired event occurs (onmouseover, onmouseout) change the source of the graphic as in the example that follows: img src= onmouseover=src=39。 SCROLLING TEXT Since the marquee tag is only supported by Inter Explorer it is a good idea to avoid it as much as possible and use a JavaScript to generate scrolling text instead. With this JavaScript it is also quite easy to place the scrolling text on the status bar instead of in the document itself by using as the destination for the message. The following function will generate a scrolling message in a text box named mymessagebox which is part of a form named myform. The event handler onload must also be used in the body tag to call the function when the page loads. var message = This is a test... var position = 0 function mymessage( ) { = (position, ) + (0, position) position = position + 1 if (position ) { position = 0 } (mymessage( ), 300) } DATES AND TIMES Dates and times are often displayed on web pages to indicate when a page was last updated, when a page was loaded, or to display a countdown to a particular event. Displaying 大連交通大學(xué) 2021 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 6 the date and time of the last update is a good practice to get in to for all of your pages because frequent updates are one sign of a quality site. The date/time stamp lets the viewer know how recent the information is and therefore provides one indication of validity. To display the date and time of the last update (the last time the document was saved) use the following one line inside of script tags: (This page last updated + ) To display the current time and date on a web page you must declare a variable of type Date ( var now = new Date). The variable can then be used t