: Stylesheet switches increase loadtime? I am using stylesheet switcher which uses a number of alternate stylesheets for the media="screen" and switches to those styles when instructed by the user.
I am using stylesheet switcher which uses a number of alternate stylesheets for the media="screen" and switches to those styles when instructed by the user.
But in the web page I have to use several http requests to link so many style sheets which increases the loadtime.
Is there anyway I can modify the code to load fast? How combining works I don't know since all style sheets are different.
More posts by @Bryan171
2 Comments
Sorted by latest first Latest Oldest Best
I don't know how you are including the alternate style-sheets, but a <link rel="alternate stylesheet" … /> will NOT be loaded by a browser automatically. Instead modern browsers like Opera or Firefox provide a menu-option, for allowing the user to switch to an alternate stylesheet. But that may also be spiced up using JavaScript. For example see "Alternative Style: Working With Alternate Style Sheets" (ALA, 2001)
Use JavaScript to add the <link> tags for each alternate stylesheet after the DOM has loaded. That way the page will load faster and while the user is looking at it, but before they have much of a chance to do anything the browser will load the alternate stylesheets in the background seamlessly.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.