Making my ajax updated div fade in

后端 未结 5 1861
野性不改
野性不改 2020-12-08 04:51

I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to g

相关标签:
5条回答
  • 2020-12-08 05:10

    JQuery.ui has a bunch of different things you can do with effects. You can find them here: http://docs.jquery.com/Effects

    0 讨论(0)
  • 2020-12-08 05:26

    You'll have to hide() it before you can use fadeIn().

    UPDATE: Here's how you'd do this by chaining:

    $("#charges-gsm-faq").hide().html(html).fadeIn();
    $("#charges-gsm-prices").hide().html(html).fadeIn();
    
    0 讨论(0)
  • 2020-12-08 05:27

    It works with load():

    $('.element').load('file.html').hide().fadeIn();
    
    0 讨论(0)
  • 2020-12-08 05:31

    You'll have to hide() it before you can use fadeIn()

    Above worked for me

    0 讨论(0)
  • 2020-12-08 05:35

    You could also leave it visible and just make it transparent, and then fade it to full opacity, using:

    ... .css({ opacity: 0 }).fadeTo("normal",1);
    
    0 讨论(0)
提交回复
热议问题