Solutions to problems encountered at work

Source: Internet
Author: User

1.enter or submit button to submit the form: The form tag is written onsubmit= "return false"; input type= "submit"; Submit statement, Form's Submit event, $ ("#form_id"). Submit ()。

Button Submit form: Input type= "button"; Commit statement, Button's Click event, $ ("#button_id"). Click ();

2.IE8 after setting the transparency, the text also becomes transparent---solution: http://www.cnblogs.com/PeunZhang/p/4089894.html

3.IE Some browsers do not support background-size---workaround: http://blog.csdn.net/auphiria/article/details/45221317

4. Using the Animate method of jquery to control element movement, you need to define the position of the element as relative, fixed, or absolute.

$ ("#div_id"). Animate ({left: "250px", Top: "100px"});

5. Page adaptive height of the jquery algorithm:

The parent height of var parentheight = $ ("#parent"). Height ();//brother high var siblingheight = 0;$ ("#self"). Siblings (). each (function () { Siblingheight + = $ (this). Outerheight (True);}); /own other heights, depending on the situation, when not valued, you can delete var selfoutheight = $ ("#self"). Outerheight (True)-$ ("#self"). Height ();//Last Result $ ("#self"). Height (parentheight-(siblingheight+selfoutheight));

6. Image fade effect, animate with jquery to change transparency: from 0.2 to 0.8 for 2 seconds

$ ("#div_id"). CSS ("opacity", "0.2"). Animate ({opacity: "0.8"},2000);

Solutions to problems encountered at work

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.