Attenuation from one style sheet to another

I thought this could be possible using jQuery or JavaScript - can someone tell me if it is possible to fade from style styles to another? If so, how to do it?

Thank!

+5
source share
3 answers

This is the best way I can think of:

$( body ).fadeOut( function() {
    // Switch the stylesheet
    // And then:
    $( this ).fadeIn();
} );
+3
source

Try the following:

JQuery

$(document).ready(function() {
    $("a").click(function() {
        var rel = $(this).attr("rel");
        $('body').hide().fadeIn(1000);  
        $('head').append('<link rel="stylesheet" href="'+rel+'" type="text/css" />');
    });

});

HTML:

<ul>
    <li><a href="#" rel="layout.css">Change to layout 1</a></li>
    <li><a href="#" rel="layout2.css">Change to layout 2</a></li>
    <li><a href="#" rel="layout3.css">Change to layout 3</a></li>
</ul>

Regards

+2
source

You can use jquery animation. But you will need to specify all the rules in the animate command.

0
source

All Articles