I am using the following code to reload a stylesheet when the user makes a selection:
<link type="text/css" id="main_style" href="css/style.php" rel="stylesheet">
<button id="secret_1" style="display:none;"></button>
$(document).ready(function(){
function freshStyle(stylesheet){
$('#main_style').attr('href',stylesheet);
}
$('#secret_1').click(function(event){
event.preventDefault();
var restyled = 'style.php?v='+Math.floor(Math.random() * 10000);
freshStyle(restyled);
});
});
In Chrome, the reload happens fluidly, and the transitions look great. In Firefox, the website temporarily becomes a garbled mess (while the stylesheet is being reloaded) for a second before the new stylesheet is active.
Is this something that can be solved with code, or is this just a feature of the Firefox browser?