This article is a collection of scripts. You are welcome to reprint this article.
Copy codeThe Code is as follows: function controlImg (ele, w, h ){
Var c = ele. getElementsByTagName ("img ");
For (var I = 0; I <c. length; I ++ ){
Var w0 = c [I]. clientWidth, h0 = c [I]. clientHeight;
Var t1 = w0/w, t2 = h0/h;
If (t1> 1 | t2> 1 ){
C [I]. width = Math. floor (w0/(t1> t2? T1: t2 ));
C [I]. height = Math. floor (h0/(t1> t2? T1: t2 ));
If (document. all ){
C [I]. outerHTML = '<a href = "' + c [I]. src + '"target =" _ blank "title =" open an image in a new window ">' + c [I]. outerHTML + '</a>'
}
Else {
C [I]. title = "opening an image in a new window ";
C [I]. onclick = function (e) {window. open (this. src )}
}
}
}
}
Window. onload = function (){
ControlImg (document. getElementById ("content"), 670,980 );
}
This code was used in the past, but because the specific ideas are not clear, I have sorted out the articles I saw in blueidea today.
The image in the specified area is generally used to control the content part. You can use the content in controlImg (document. getElementById ("content"), 670,980); below is the test code.<Br/> The following is the region to be controlled. </P> source image <center> </center> <br/> tutorial layer: <br/> 1. Copy the source image layer <br/> 2. Execute the layer <new adjustment layer <color/saturation parameters are not described <br/> 3. Execute the layer <new adjustment layer <Curve <br/> four colors and then reduced opacity <br/> five layers <new adjustment layer <brightness/contrast <center> </center> <p> The following is not subject to control, for more information, see. <Br/> source image <center> </center> <br/> tutorial layer: <br/> 1. Copy the source image layer <br/> 2. Execute the layer <new adjustment layer <color/saturation parameters are not described <br/> 3. Execute the layer <new adjustment layer <Curve <br/> four colors and then reduced opacity <br/> five layers <new adjustment layer <brightness/contrast <center> </center> <br/>