GithubHelp home page GithubHelp logo

infario / colorpanel Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 4.0 409 KB

Simple jQuery plugin to switch css stylesheet skin theme on your template demo

License: MIT License

CSS 68.20% JavaScript 31.80%

colorpanel's Introduction

colorpanel

Simple jQuery plugin to switch css stylesheet skin theme on your template demo

Demo and usage guide

How to use

Include plugin Stylesheet on your head

 <link href="dist/jquery.colorpanel.css" rel="stylesheet">

Include skin Stylesheet on your head with id

<link href="skins/default.css" id="cpswitch" rel="stylesheet">

Add panel html code within your body tag

If you want to have transition effect on change of stylsheet have the panel code out of your animate container div : ie #wrapper

  <div id="colorPanel" class="colorPanel">
        <a id="cpToggle" href="#"></a>
        <ul></ul>
    </div>

Include script on your footer below jQuery

 <script src="dist/jquery.colorpanel.js"></script>

call the plugin code on your document ready event

$('#colorPanel').ColorPanel({
            styleSheet: '#cpswitch'
            , animateContainer: '#wrapper'
            , colors: {
                '#4B77BE': 'skins/default.css'
                , '#16a085': 'skins/seagreen.css'

            , }
        });

Options

            {
            styleSheet: '#cpswitch'
            , colors: {
                '#1abc9c': 'skins/default.css'
                , '#2980b9': 'skins/blue.css'
                , '#c0392b': 'skins/red.css'
            , }
            , linkClass: 'linka'
            , animateContainer: false
            }
Name Type Default Description
styleSheet string | selector '#cpswitch' pass the id of your skin stylesheet link tag
colors object { '#1abc9c': 'skins/default.css' , '#2980b9': 'skins/blue.css' , '#c0392b': 'skins/red.css' , } list of color options you are providing as object. Hex color codes as Key and css file path as value
animateContainer string | Selector or false false pass the container div for whole page to make fadeIn , fadeOut transition
linkClass string 'linka' pass the classname for color anchor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.