Frontend Development

Creating a color picker using jQuery

Submitted by Burned Designs, , Thread ID: 20922

Thread Closed

RE: Creating a color picker using jQuery

OP
This post was last modified: 05-05-2016, 05:11 AM by Burned Designs
#3
You can expand past adding classes with this jquery you can have an if statement like this
Code:
if($("#container").hasClass('red')){
  $("#container").css({"border":"1px solid #c13333","background":"#efefef"});
}

Be warned though If you are using ajax on a set of code that color will not take affect unless you load that cookie before the ajax is loaded which can be done in css and jquery like so
Code:
/* CSS Below */
html,body{
  visiblity:hidden;
}

// Jquery below
document.getElementsByTagName("html")[0].style.visibility = "visible";
document.getElementsByTagName("body")[0].style.visibility = "visible";
[Image: SIG.PNG]

Users browsing this thread: 2 Guest(s)