Jquery fade-in, fade-out event fadein fadeout

Source: Internet
Author: User

Jquery fade-in, fade-out event fadein fadeout

1. The fadein () method uses the fade-in effect to display the selected element (this element is hidden)

$(selector).fadeIn(speed,callback)

Parameter descriptionSpeed,Optional. Specifies the speed at which elements are hidden to be visible. The default value is "normal ". Possible value: Millisecond (for example, 1500) "slow" "normal" "fast"

Callback, optional. The function to be executed after the fadein function is executed. (This parameter cannot be set unless the speed parameter is set)

2. fadeout ()

Fadeout (speed, [callback]) fades out all matching elements by changing the opacity, and triggers a callback function after the animation is complete.

This animation only adjusts the opacity of the element, that is, the height and width of all matched elements do not change.

A string ("slow", "normal", or "fast") with one of the three predefined speeds or a millisecond value (for example, 1000) indicating the animation duration)

3. Bug about invalid fadein and fadeout methods of jquery in IE

Bug1: absolute positioning nesting absolute positioning

After the solution is changed to floating, the fade-out effect can be achieved.

Bug2: parent-level absolute positioning of nested pictures larger than parent-level size

Adjust the size.

Bug3: IE6 IE7 IE8 fadein () fadeout () Bug at position: relative

If the child element of the fadein element has the position attribute, the element with the relative value as the most serious position attribute will not have the fadein effect!

Solution: change the position attribute to relative dynamically before fadein (). This will solve this bug in IE7.

Watermark ('.fadein').css ('position', 'relative '). fadein ();

Add filter: Inherit to the element whose child element has the position attribute. Add the first child element of the current element. These two problems are solved by combining ie678.

. Relative {position: relative; filter: Inherit}

Reference: http://www.cnblogs.com/lxiang/archive/2012/05/07/2482530.html

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.