2
Hello. I have this code in Jquery:
$('#prods').fadeOut(300, function(event){
chamaM(id_m);
});
$('#prods').fadeIn(300);
ChamaM()
is an AJAX function that makes a call to PHP code, displaying the content within the div #prods
.
It’s all working, but what’s happening is that when the fadeout completes the previous content it stays there, like, the fadeout()
and fadein()
happen in the current content and only then it loads the new content. In the test environment (XAMPP) everything works perfectly, but in the site server this error happens.
The address, so you can view is: www.lumiledbrasil.com.br/products.php
I have tried some variations of functions and order of them, but without success. Can anyone help me? I thought only this code was needed. If you need more information, just let me know. I really appreciate it all!
It flashes the product that was in focus before moving on to the clicked on, right? I guess it has nothing to do with that, I think the
$('#prods').fadeIn(300);
has to be part of the function right after AJAX or even inside AJAX itself as Return.– Marcos Vinicius
is what happens. If you notice, what it does is give fadeout(), and start fadein() on the content that was already in focus. Only then does it load the new content without fadein(). I believe it has something to do with the speed at which Ajax or Jquery evaluate the functions. But I can’t find the solution.
– Dtag