The first step is to save the Web page as a canvas canvas, with the help of the Html2canvas library, http://html2canvas.hertzen.com/
Html2canvas (document.getElementById ("Id1"), {
onrendered:function (canvas) {
document.getElementById ("Id2 "). AppendChild (Canvas)//What to do after generating the canvas, of course, it can be opened in the new tab, displayed in the floating layer, etc.
},
canv
. For convenience, when defining the modal mode dialog box, unit with PX.2. dialogwidth: Dialog Box width.3. dialogleft: the distance from the left of the screen.4. dialogtop: the distance from the screen.5. Center: {Yes | no | 1 | 0}: whether the window is centered. The default value is yes, but the height and width can still be specified.6. Help: {Yes | no | 1 | 0}: whether to display the Help button. The default value is yes.7. resizable: {Yes | no | 1 | 0} [ie5 +]: whether the size can be ch
Get the background color and font color of the Web page, as follows:nbsp; nbsp; thought: By obtaining the color property is worth to the RGB color, is not what we want, so you need to change the RGB color to hexadecimal color, first get RGB color:nbsp; copy code code as follows: Var RG b = document.getElementById (' color ') .style.backgroundcolor;nbsp; nbsp; get format as follows: RGB (225, 22, 23); Then s
The following JS code gets all the hyperlinks in the Web page by Document.links to get the number of links
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16-17
The results of the operation are as follows:
1
number of Areas/links:4
The following demo address is local gray
Local Gray demo Address: http://demo.jb51.net/js/grayscale/index.html
Full Grey demo Address: http://demo.jb51.net/js/grayscale/demo2.htm
How to use:
1. First introduce the Grayscale.js file into the Web page.
2. Perform the grayscale function.
Sample code:
Copy Code code as follows:
Grayscale (document.body); The whole station turns gray.
Graysca
This article mainly introduces how to use AJAX to implement the Web page progress bar. It is a popular practice to use AJAX to asynchronously display the processing progress of the server, for more information about how to install and download an application, see progress bars. A progress bar can be used to indicate the progress of a project. It can be expressed as a percentage or number and can be placed h
The following code gets all the pictures in the Web page through Document.images, and then gets the id attribute of the first picture
1 2 3 4 5 6 7 8 9 10 11 12-13
The results of the operation are as follows:
1
Id of the Image:klematis lilac
The principle is to loop through the controls on the Web page, and then set the Disabled property to true.
The code is as follows:
Copy Code code as follows:
The following are the types of these controls:
can be obtained by Document.getelementsbyname ("ControlName") [0].type.tolocalelowercase ().
There are several types of controls depending on their differences:"Text""TextArea""S
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.