Javascript function to check whether the image size exceeds the expected size

Source: Internet
Author: User

I found that using ASP to determine the image size is more complicated than that of taobaomao. When I judge the image size, I will judge it. I also need to display it logically... annoying. it is easy to use Javascript to judge and solve the problem. The final effect is nothing more than making large images break the page.

 

<Script LANGUAGE = "JAVASCRIPT">
// Check whether the image size is greater than the expected size. If the image size is greater than the expected size, it is displayed as the expected size.
Function show (chkw) {// chk images width
If (chkw & gt; 500 ){
Chkw = 500;
}
Else {
Chkw = chkw;
}
Return chkw;
} // Shawl. qiu script
// Example
</Script>

 

1. Check box automatically selected with the mouse cursor:

<Input TYPE = "checkbox" onMouseMove = "checked = true">
<Input TYPE = "checkbox" onMouseMove = "checked = true">

 

2. ACCESS Lists the days of a day in a week.

// This algorithm takes an hour.

Query the data of all days of a day in a week.

SELECT *
FROM ctdate_by_query_date
WHERE dateandtime between (#2006-5-15 # + Weekday (2006-5-15)-6) and #2006-5-15 # + Weekday (2006-5-15)

 

3. Double-click the mouse to copy the text. Double-click the mouse to copy the text.

<Script LANGUAGE = "JAVASCRIPT">
Function ClipBoard (tdObj) {// IE Only
Var holdtext = document. all ['holdtext'];
Holdtext. innerText = tdObj. innerText;
Copied = holdtext. createTextRange ();
Copied.exe cCommand ("Copy ");
Alert ("text copied ");
}
</Script>
<Form NAME = "form1" METHOD = "post" ACTION = "">
<Ttextarea id = "holdtext" style = "display: none" ROWS = "10"> </ttextarea>
</Form>


Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.