Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 318993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:37:14+00:00 2026-05-12T08:37:14+00:00

I have seen many css switchers which place a button allowing the user to

  • 0

I have seen many css switchers which place a button allowing the user to change styles to suit their taste. I am looking for a similar solution that I have not yet found.

This is the closest: http://net.tutsplus.com/demos/03_jQueryStyleSwitcher/demo/index.php#

I want my page to fade from one style sheet to the next every x seconds, so css completely changes every x seconds. I want to do it in jquery for simplicity and some nice transitions. Again, I want this to happen AUTOMATICALLY, without the click of any button. Anybody see any code out there that can do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:37:14+00:00Added an answer on May 12, 2026 at 8:37 am

    You could scavenge the code that actually loads the stylesheet and trigger it from a setInterval call instead of a button click. You’d need to supply the url for the stylesheet. This could be stored in a javascript array and you could simply rotate through the elements of the array (or pick one randomly) in the function triggered by the interval timer. You’d then advance the index (mod array size) to get the next style to display.

    var styles = [ '/example.com/css/style1.css', '/example.com/css/style2.css' ];
    var currentStyle = 0;
    
    setInterval( function() {
           currentStyle = (currentStyle + 1) % styles.length;
           loadStylesheet( currentStyle );
    }, 5000 );
    

    Update: I spent some time today converting the example into a plugin that works for me with a select. You can find the code on my blog, http://farm-fresh-code.blogspot.com/2009/08/jquery-theme-manager-plugin.html. Here’s how I would probably proceed to use it. This would work with theme1.css, theme2.css, etc. That is styles at the urls: /example.com/styles/theme1.css, …

    Script:

    var currentTheme = 0;
    var themes = $('.theme');
    themes.retheme({
       baseUrl: '/example.com/styles',
       loadingImg: '/example.com/images/image.gif'
    });
    
    setInterval( function() {
        currentTheme = (currentTheme + 1) % themes.length;
        themes.eq(currentTheme).trigger('click');
    });
    

    Html:

    <input type='hidden' class='theme' value='theme1' />
    <input type='hidden' class='theme' value='theme2' />
    <input type='hidden' class='theme' value='theme3' />
    

    Demo:

    A demo of the code using both a select and links can be found at http://myweb.uiowa.edu/timv/retheme-demo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many question and applied their results but nothing happens I still
I have seen many developers writing HTML or CSS inline style widths of 99.9%
I have seen many js frameworks (including jquery) using closure around their main function
What is foo? I have seen it in many CSS and Web designing examples
I have seen many tutorials which suggest cloning of andengine and its extensions by
I have seen many posting this issue in SO. I have gone through those
I have seen many time that far pointers are used to work for TSR.
I have seen many answers for this type of question but its not related
I have seen many articles about POCO. What is this?
I have seen many articles and Questions/Answers Regarding Lock Escalation but following things are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.