I have a div with being replaced by specific user actions. These actions are performed under the replaceable div, and in the case when the div is too large to fully fit into the viewport, as well as the buttons used to change it, the browser will move to the beginning of the newly loaded case. This is annoying.
Does anyone know how to stop this? Greetings.
Here is the jQuery code. ChartContent is a small html frame
function UpdateChartImage(ChartContent) {
var existingChart = $("#" + $(ChartContent).attr("id"));
existingChart.fadeOut("fast", function() { existingChart.replaceWith(ChartContent); }).fadeIn("fast");
}
By the way, I forbade the button to do this by default, so I do not think that this is due to this.
source
share