GIF images with animations cannot work normally in IE.

Source: Internet
Author: User

IE and firfox are more or less different in many places, which leads to many special situations that need to be considered during development. In a recent project, we found that GIF images with animations are displayed in script-controlled mode after the pages are loaded. In my project, you need to click a button to display a dynamic loading image.ProgramProcessing in the background. This is through a section of jqueryCodeTo achieve:

 
Function showmessage (){...... $ ("Div # processing "). show ();......} <Div id = "processing" style = "display: none"> <center>  </center> </div>

IE shows the image, but the animation cannot be played. But it works normally in firfox. When you add the entire Div to the Dom, this div is hidden and invisible. However, when you set its attribute to visible, the animation cannot be played normally. If you add an animated GIF image to the DOM in a visible way, it can be correct and play the animation. You can change the Code as follows:

<Script language = "JavaScript" type = "text/JavaScript"> function showmessage () {$ ("Div # processing "). show (); var imgsrc = '<% = resolveurl ("~ /Images/Checkout/placeorder_processing.gif ") %> '; $ (" TD # imgsection "). append ("
 
In this way, you can solve this problem by adding IMG to the DOM in the visible content.

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.