Today, due to project overtime, two problems need to be solved.
1. dynamically changing the DIV height, so I searched on Google and found several useful links to solve my needs.
-Sometimes you define a style for a DIV, such as width = 50%, but you do not know the true width of the Div. You can obtain it in the following ways:
X = Document. getelementbyid ('testdiv ');
VaR xheight = x. offsetwidth;
Javascript has four such attributes: offsetheight, offsetleft, and offsettop. Note that these attributes are read-only.
-Set the DIV height and width:
X = Document. getelementbyid ('testdiv ');
X. style. Height = 100;
These two points help solve my needs.
Here is a link to one of my reference documents:
Get styles
Http://www.quirksmode.org/dom/getstyles.html
2. Use JavaScript to display some Tool tips on the page
-This is relatively easier. I have seen a website before.
Http://www.walterzorn.com/tooltip/tooltip_e.htm
After downloading the above document, I wrote a static html test, but tips cannot be displayed.
Later, I carefully read the text marked in red in the document.
Insert the following lines into the <body> section or your HTML file, preferably immediately before the closing </body> tag, but in any case after the last tag containing a tooltip:
<Script language = "JavaScript" type = "text/JavaScript" src = "wz_tooltip.js"> </SCRIPT>
<Script language = "JavaScript" type = "text/JavaScript" src = "wz_tooltip.js"> </SCRIPT> should be placed at the end of the page before being introduced, or at least after the last tooltips.
Finally, another problem was solved.
There is also a link on which there are many other tooltips implementation links. You can refer to the selection:
Http://www.blinklist.com/tag/tooltip/