Proper way to reset a GIF animation with display:none on Chrome

后端 未结 11 1595
暗喜
暗喜 2020-12-03 05:21

Title is self-explanatory, but I\'ll provide a step-by-step view on the matter. Hopefully I\'m not the first one to have noticed this (apparently) bug on Webkit/Chrome.

11条回答
  •  心在旅途
    2020-12-03 05:40

    This solution preloads the gif and takes it out of the dom and then back in the src (thus avoiding another download)

    I just tested it using jquery to remove the attribute and it works fine.

    Example:

    
    
    
    
    
    
    
    
    
    
        
        reset gif
    
    
    

提交回复
热议问题