Jump to content

[SOLVED] preload stylesheets


DeanWhitehouse

Recommended Posts

I have made this function to laod a different style sheet when they change a drop down box.

<script type="text/javascript">
function preview()
{
var theme =document.reg.theme.value;
document.getElementById("style").href = theme;
}
</script>
<html>
<body>
<select id="theme" name="theme" onChange="preview()">
<option value="original.css">Original</option>
<option value="classic.css">Classic</option>
<option value="dark.css">Dark</option>
<option value="light.css">Light</option>
<option value="modern.css">Modern</option>
</select>
</body>
</html>

 

My problem is that there is a lsight delay before it loads the next style sheet.

Is there any way to preload the style sheets?

Link to comment
https://forums.phpfreaks.com/topic/112486-solved-preload-stylesheets/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.