Clever solutions for jquery and its plug-ins

Source: Internet
Author: User

When developing the Sina Weibo plug-in for Ao you, jquery encountered some problems. The reasons and solutions are as follows.

 

1. thickbox Parameters

In the thickbox example, it is called as inline, for example, # tb_inline?Height= 300 &Width= 300 &Inlineid= Myonpagecontent.

However, the height of the pop-up layer cannot be set for this call. When the tb_parsequery method is debugged, it is found that the above entire string is passed in, while the parse method separates Parameters Based on; or, the first parameter cannot be obtained.

Clever solution: Add a useless parameter to replace height as the first parameter. For example, # tb_inline? A = &Height= 300 &Width= 300 &Inlineid= Myonpagecontent.

 

2. slidedown when using the interface

When the interface plug-in is used, if the element is in the center, slidedown will generate a shift. When it appears, it will suddenly appear on the leftmost side, and then appear in the center with the click or hover.

Clever solution: Set another DIV in the outer layer and use the slidedown method for this Div.

 

3. thickbox Leakage

When thickbox displays a DIV, only the elements in it are displayed, without the background of this Div.

Clever solution: Use a div to contain all the elements, and set the CSS attribute of the div.

 

4. Problems with slide of Relative Elements

The relative element is relative positioning. If the element to be located also needs slide, the position of this element will be erratic.

Clever solution: discard relative positioning and use js to calculate the margin of this element to replace left and top attributes.

 

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.