Sure, Firstly, just as a reminder, the main function you call to change the stylesheet is:
Code:
chooseStyle('themename', 60)
Where "themename" is the name of the stylesheet based on its "title" attribute to change to. So what you want is basically a way to call this function with a different "themename" each time, in sequential order. What you'd so is first store all the names of the themes you wish to rotate through in a JavaScript array:
Code:
var mystylesheets=["none", "blue-theme", "brown-theme"]
Then, use a script like the following to change to each one sequentially when a function is called. Here's the complete script:
Code:
<script type="text/javascript">
var mystylesheets=["none", "blue-theme", "brown-theme"]
var cursheet=0
function rotateStyle(){
chooseStyle(mystylesheets[cursheet], 60)
cursheet=(cursheet<mystylesheets.length-1)? cursheet+1 : 0
}
</script>
<a href="javascript:rotateStyle()">Change Theme</a>
Bookmarks