/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Loads a stylesheet at random. Pass each stylesheet as an argument. function loadRandomStylesheets(stylesheets) { if(arguments.length < 1) return false; var url = arguments[Math.round(Math.random() * (arguments.length - 1))]; var html = '<style type="text/css">\ @import url(' + url + ');\ </style>'; document.write(html); return true; }