Also encountered color theme changes, this time using the JQUERY+CSS, using the function of the value, rather than the previous site changes the way link.
First of all, after setting the color theme, click Change page color theme. (You need to import jquery.js yourself to see the effect)
Direct Sticker Code:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title> <Scripttype= "Text/javascript"src= "Js/jquery.js"></Script></Head><style>Div Section{width:30px;Height:30px;margin:10px;Display:Inline-block; }Div Section:nth-of-type (1){Background-color:#177cb0; }Div Section:nth-of-type (2){Background-color:#db5a6b; }Div Section:nth-of-type (3){Background-color:#008000; }Div Section:hover{cursor:Pointer; }</style><Body> <Div> < Sectiononclick= "Blue ()"></ Section> < Sectiononclick= "Red ()"></ Section> < Sectiononclick= "Green ()"></ Section> </Div> <Center> <H2style= "Display:inline-block;">Color Theme jquery Transform</H2> <formAction=""ID= "SimpleCalc"> <span>Input</span><inputtype= "text"Required><BR><BR> <ButtonID= "Calc">Confirm</Button> </form> <spanID= "Result"></span> </Center> <Script> //set the default color theme$ (document). Ready (function() {blue (); }); //Click a single color change functionBlue () {Change ("#177cb0"); } functionRed () {Change ("#db5a6b"); } functionGreen () {Change ("#008000"); } //set the elements and their styles that need to change color functionChange (colo) {$ ("#calc"). CSS ("Background-color", Colo); $("H2, span"). CSS ("Color", Colo); $("input"). CSS ("Color", Colo); $("Input[type=text]"). Focus (function(){$( This). CSS ("Outline", "None")}); $("Input[type=text]"). Focus (function(){$( This). CSS ("Border", "2px Solid" +Colo)}); $("Input[type=text]"). Blur (function(){$( This). CSS ("Border", "1px solid Gray")}); } </Script></Body></HTML>
Next post code that changes the color theme in real time (by inputting the color value by input).
If there is any mistake, please correct me!
Jquery+css implement Web page color theme Transformations (change only several color themes that have been set)