I need a little help. I'm struggling with some problem for a while. I need to call jquery load function every time i click on a button. To trigger load function I suppose I need to refresh that particular div or load that div again.
My goal is:
when I click on the button I want loading-div to be shown and I want .image-container to load again. I suppose that should trigger jquery load function that will hide loading-div when .image-container loads.
This is my code:
$(".image-container").load(function(){
$( "#loading-div" ).hide();
});
$("#button").on('click', function(){
$( "#loading-div" ).show();
$(".image-container").load("index.php"); // load again div that sholud trigger upper function
});