I am new to jquery. I have recently designed a website in which I need to implement a color selector.
and the customer demands that he need a color selector as used in the website http://www.dulux.in/color_pallette_start.jsp
please help me how can i design it using jquery
I am new to jquery . I have recently designed a website in which
Share
I can guide you with a simple theme selector, using jQuery. You have a few steps before you finish.
Part 1: The content.
Lets have a sample content this way:
Define the layout CSS for this:
Part II: Theme CSS
Say we have three themes. Light, Dark and Blue. The CSS for the same:
Part III: Now the JavaScript / jQuery switcher.
We just need to add or remove the classes. Since we know the names of the themes, we will remove all the classes and add the correct class.
We have added this handler to the links. Now we need to update the links with the name of the themes.
Now upon clicking on the respective themes, the theme of the document gets changed.
Fiddle: http://jsfiddle.net/QSZ3R/
Hope you understood and it is easy! 🙂
For a colour palette, you can think of using Color Picker – jQuery Plugin.