JS easy to implement CSS settings, div+css common CSS settings _javascript skills

Source: Internet
Author: User
Tags eval tagname visibility
Earlier, I saw a Japanese-style http://www.99yp.com/uploads/200607/css/index.htm in the DW of a bird, written by a large pile of code, which, by now, was useless, and the little Dove wrote a better style builder for the DIV+CSS Architecture Web page.
(In Internet cafes do Web page friends, you can use this AH!) will be commonly used to write out the style, to make the expansion of DW how good, trouble master him into the expansion of DW:
Small Pigeons Personal network: http://xbnz.126.com/[Web site help remember: New White snake]
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <!--┌─────" The Love Ting Entertainment show "────────┐│ favorite clove flower Vickey Chen qq:106456213 │└───────.net (WEB2.0) ───────┘--> <pead> <meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 "> <title>▒ ting div+css editor beta1.0</title> <style type=" text/css "media=" screen "> & lt;! --html,body{height:100%;} *{FONT-SIZE:12PX}. Vcsseffect{background-color: #fff; Background-image:url (http//vickeychen.ik8.com/css/grid.gif); Hiddenobj{display:none}. normal_input{border:1px solid #84a1bd Background-color: #fff; height:18px; Hover_input {border:1px solid #9ecc00; Background-color: #fff; height:18px;}. vcssdetail{padding:15px;padding-top:0px}. maindialogcss{width:550px; float:left; detailcssboxmodel{height:100%; float:left; mainbody{height:400px;} --> </style> <script language= "JavascriPT "Type=" Text/javascript > <!--function hoverinput (obj,n) {if (n==1) {if (obj.tagname== "INPUT" && ob j.type== "text") {obj.classname= ' Hover_input ';}} else{if (obj.tagname== "INPUT" && obj.type== "text") {obj.classname= ' normal_input '; if (obj.value!= ' &&!isnan (obj.value.substring (obj.value.length-1)) obj.value+= ' px '; } setselectionwithcss (2); } var allcsssettercode = ""; function Setselectionwithcss (funnum) {issetting (vcsswidth, "width"); Issetting (vcssheight, "height"); Issetting (Vcssbackgroundcolor, "Background-color"); Issetting (Vcsscolor, "color"); Issetting (Vcssborderwidth, "border-width"); Issetting (Vcssbordercolor, "Border-color"); Issetting (Vcssborderdstyle, "Border-style"); Issetting (Vcssmargin, "margin"); Issetting (vcsspadding, "padding"); Issetting (Vcssfloatresult, "float"); Issetting (Vcssdisplay, "display"); Issetting (VcssvisiBilityresult, "visibility"); Issetting (vcsstextalign, "text-align"); Issetting (Vcsslineheight, "line-height"); Issetting (vcsstextindent, "text-indent"); Issetting (Vcssfontsize, "font-size"); Issetting (vcssfontfamily, "font-family"); Issetting (Vcssfontweight, "font-weight"); Issetting (Vcssdecorationresult, "text-decoration"); Issetting (vcssposition, "position"); Issetting (Vcsszindex, "Z-index"); Issetting (Vcssleft, "left"); Issetting (Vcssright, "right"); Issetting (Vcsstop, "top"); Issetting (Vcssbottom, "bottom"); Issetting (Vcsspositionresult, "list-style-position"); Issetting (vcsscursor, "cursor"); Issetting (Vcssbackgroundrepeat, "background-repeat"); Issetting (vcssbackgroundattachment, "background-attachment"); Issetting (Vcssliststyletype, "List-style-type"); Issetting (Vcssoverflow, "overflow"); Issetting (Vcssclear, "clear"); Issetting (vcssverticalalign, "vertical-align"); if (vcssbackgroundimage. value!= "") allcsssettercode+= "Background-image:url (" +vcssbackgroundimage.value+ ");"; if (vcssbackgroundpositionx.value!= "" && vcssbackgroundpositiony.value!= "") allcsssettercode+= " Background-position: "+vcssbackgroundpositionx.value+" "+vcssbackgroundpositiony.value+"; if (vcssliststyleimage.value!= "") allcsssettercode+= "List-style-image:url" ("+vcssliststyleimage.value+"); "; if (funnum==1) {alert (allcsssettercode); else {var everyrule = Allcsssettercode.split (';'); var resultcsstext=vcssidentname.value+ "\r\n{\t"; for (Var v=0;v<everyrule.length-1;v++) {resultcsstext+=everyrule[v]+ "; \r\n\t"; } resultcsstext+= "\ r \ n}"; Document.all.csstextvalue.value=string (Resultcsstext); Document.all.csstextvaluecompare.value=string (Allcsssettercode); Vcsseffect_div.style.csstext=string (Allcsssettercode); } allcsssettercode= ""; } var Isfisrtgetcss = true; function Getselectionwithcss (funnum) {isgetting ("Vcsswidth", "width"); Isgetting ("Vcssheight", "height"); Isgetting ("Vcssbackgroundcolor", "backgroundcolor"); Isgetting ("Vcsscolor", "color"); Isgetting ("Vcssborderwidth", "borderwidth"); Isgetting ("Vcssbordercolor", "bordercolor"); Isgetting ("Vcssborderdstyle", "BorderStyle"); Isgetting ("Vcssmargin", "margin"); Isgetting ("vcsspadding", "padding"); Isgetting ("Vcssfloat", "float"); Isgetting ("Vcssdisplay", "display"); Isgetting ("Vcssvisibilityresult", "visibility"); Isgetting ("Vcsstextalign", "textAlign"); Isgetting ("Vcsslineheight", "lineheight"); Isgetting ("Vcsstextindent", "textindent"); Isgetting ("Vcssfontsize", "fontsize"); Isgetting ("vcssfontfamily", "fontFamily"); Isgetting ("Vcssfontweight", "fontweight"); Isgetting ("Vcssdecorationresult", "textdecoration"); Isgetting ("Vcssbackgroundimage", "backgroundimage"); Isgetting ("VcssbackgroundRepeat "," backgroundrepeat "); Isgetting ("Vcssbackgroundattachment", "backgroundattachment"); Isgetting ("Vcssliststyletype", "listStyleType"); Isgetting ("Vcssliststyleimage", "liststyleimage"); Isgetting ("Vcsspositionresult", "liststyleposition"); Isgetting ("Vcsscursor", "cursor"); } function issetting (Cssobj,cssstartparam) {if (cssobj.value!= "") allcsssettercode+=cssstartparam+ ":" +cssobj.value+ ";"; } function isgetting (Cssobj,cssstartparam) {if (isfisrtgetcss) {ele = document.getElementById ("VV"); if (eval ("Ele.style.") +cssstartparam)!= "") {Document.all[cssobj].value=eval ("Ele.style.") +cssstartparam); }}//--> </script> <script> var sinitcolor = null; function Callcolordlg (obj) {if (Sinitcolor = = null) var Scolor = Dlghelper.choosecolordlg (); else var scolor = Dlghelper.choosecolordlg (Sinitcolor); Scolor = scolor.tostring (16); if (Scolor.length &LT 6) {var stempstring = "000000". substring (0,6-scolor.length); Scolor = Stempstring.concat (Scolor); } if (scolor!= "000000") {scolor = "#" + Scolor; Obj.value=scolor; Obj.style.backgroundcolor=scolor; } </script></pead><object id=dlghelper classid= "clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width= "0px" height= "0px" ></OBJECT><body> <div class= "mainbody" id= "mainbody" > <div onmouseover= " Hoverinput (event.srcelement,1); "onmouseout=" Hoverinput (event.srcelement,2); "Onkeyup=" SetSelectionWithCss (2); " class= "Maindialogcss" > <div id= "vcssdetail_div" class= "Vcssdetail" ><p> class/label/id:<input name= " Vcssidentname "id=" Vcssidentname "value=" Style1 "class=" Normal_input "onmouseover=" select (); "Onmouseout=" Event.cancelbubble=true;this.classname= ' normal_input '; "/> All values are not input units; Width: <input name= "Vcsswidth" type= "text" class= "Normal_input" id= "Vcsswidth" value= "" size= "8"/> High: <input name= " Vcssheight "type=" text class= "Normal_input" id= "Vcssheight" value= "size=" 8 "/> Background color: <input name=" Vcssbackgroundcolor "type=" text "class= "Normal_input" id= "Vcssbackgroundcolor" onmouseout= "event.cancelbubble=true;this.classname= ' normal_input ';" = "" size= "8" onclick= "Callcolordlg (This)"/> foreground color: <input name= "Vcsscolor" type= "text" class= "Normal_input" id= " Vcsscolor "value=" "size=" 8 "onmouseout=" Event.cancelbubble=true;this.classname= ' normal_input '; "onClick=" Callcolordlg (This) "/> border: <input name=" Vcssborderwidth "onclick=" value=1;vcssborderdstyle.value= ' solid '; " Type= "text" class= "Normal_input" id= vcssborderwidth "value=" "size=" 8 "/> Color: <input name=" Vcssbordercolor "type = "text" class= "Normal_input" id= "Vcssbordercolor" value= "" size= "8" onclick= "Callcolordlg (This)" onmouseout= " Event.cancelbubble=true;this.classname= ' normal_input '; "/> <select name=" Vcssborderdstyle "id=" Vcssborderdstyle "onclick=" if (value== ') value= ' solid '; > <option selected> Selection <optiOn value= "SOLID" >solid<option value= "dotted" >dotted<option value= "None" >none<option value= " Hidden ">hidden<option value=" dashed ">dashed<option value=" double ">double<option value=" Groove " >groove<option value= "Ridge" >ridge<option value= "inset" >inset<option value= "outset" >outset </select> outer spacing Margin: <input name= "Vcssmargin" type= "text" onkeydown= "if (event.keycode==32) this.value+= ' px ' ; "class=" Normal_input "id=" Vcssmargin "value=" "size="/> such as: 10px 2px spacing padding:<input name= "vcsspadding" Type= "text" onkeydown= "if (event.keycode==32) this.value+= ' px ';" onblur= "if (this.value!= ' &&!isnan ( This.value.substring (this.value.length-1)) this.value+= ' px '; "class=" Normal_input "id=" vcsspadding "value=" "size=" "/>" such as: 10px 2px float: Left <input type= "Radio" name= "Vcssfloat" onclick= "if (this.checked) vcssfloatresult.value=this . Value "value=" left "> Right <input name=" Vcssfloat "type=" Radio "onclick=" if (this. Checked) Vcssfloatresult.value=this.value "value=" right "><input name=" Vcssfloat "type=" Radio "class=" Hiddenobj "id=" unsetfloat "onclick=" if (this.checked) vcssfloatresult.value= ";"/>x<input name= " Vcssfloatresult "type=" hidden/> Display: <select name= "Vcssdisplay" id= "Vcssdisplay" > <option selected> Selection <option value= "Block" >block <option value= "inline" >inline <option value= "None" >none </selec T> visible: <input type= "Radio" name= "vcssvisibility" value= "visible" onclick= "if (this.checked) Vcssvisibilityresult.value=this.value "> Visible <input type=" Radio "name=" vcssvisibility "value=" hidden "onClick=" if (this.checked) vcssvisibilityresult.value=this.value "> Hidden <input type=" Radio "name=" Vcssvisibility "class=" Hiddenobj "id=" unsetvisibility "onclick=" if (this.checked) vcssvisibilityresult.value= ";"/>x<input name= " Vcssvisibilityresult "type=" hidden/> Text alignment: <select name= "vcsstextalign" id= "Vcsstextalign" OnclIck= "if (value== ') value= ' center ';" > <option selected> Select </option> <option value= "left" >left</option> <option value= "ce Nter ">center</option> <option value=" right ">right</option> </select> line height: <input name=" Vcsslineheight "type=" text "class=" Normal_input "id=" Vcsslineheight "onmouseout=" event.cancelbubble=true; This.classname= ' normal_input '; "value=" "size=" 8 "/> <select name=" Vcsslineunit "id=" Select5 "> <option val Ue= "%" >%</option> <option selected> no </option> <option value= "px" >px</option> </ select> text indent: <input name= "vcsstextindent" type= "text" class= "Normal_input" id= "VcssLineHeight4" "value=" "size=" 8 "/> Text: <input name=" Vcssfontsize "type=" text "class=" Normal_input "id=" Vcssfontsize "value=" 12px "size=" 5 "/&G T Font: <select name= "vcssfontfamily" id= "vcssfontfamily" if (onclick= ") value== ' Arial '; ><option selected> Select </oPtion><option value= "XXFarEastFont-Arial" > <option value= "black body" > Blackbody <option value= "Arial" >arial<option value= " Microsoft ya Black "> Ya black </select> thickness: <input name=" Vcssfontweight "type=" text "class=" Normal_input "id=" VCSSLINEHEIGHT3 " Value= "" "size=" 8 "onmouseout=" Event.cancelbubble=true;this.classname= ' normal_input '; "/> Effect: <input type=" Radio "Name=" Vcsstextdecoration "value=" underline "onclick=" if (this.checked) vcssdecorationresult.value=this.value "> Underscore <input type=" Radio "name=" Vcsstextdecoration "value=" None "onclick=" if (this.checked) Vcssdecorationresult.value=this.value "> No <input type=" Radio "name=" vcssvisibility "class=" HIDDENOBJ "id=" Unsetdecoration "onclick=" if (this.checked) vcssdecorationresult.value= '; "/>x<input name=" Vcssdecorationresult "type=" hidden "/> background picture: <input name=" vcssbackgroundimage "type=" file "class=" Normal_input " Id= "Vcssbackgroundimage" > Repeat: <select name= "Vcssbackgroundrepeat" id= "Vcssbackgroundrepeat" onclick= "if" (value= = ') value= ' no-repeat '; ><option selected> Select <option value= "Repeat-x" > Horizontal repeat <option value= "repeat-y" > Longitudinal repeat <option Value= "No-repeat" > No repeat </select> horizontal position: <input name= "Vcssbackgroundpositionx" type= "text" class= "Normal_ Input "id=" Vcssbackgroundpositionx "value=" "size=" 5 "/> Vertical position: <input name=" Vcssbackgroundpositiony "type=" text " class= "Normal_input" id= "Vcssbackgroundpositiony" value= "" size= "5"/> Attachment: <select name= " Vcssbackgroundattachment "id=" vcssbackgroundattachment "onclick=" if (value== ') value= ' fixed '; ><option selected> Select <option value= "fixed" > Fix <option value= "scroll" > Rolling </select> Vertical alignment: <select name= "vcssverticalalign" id= "Vcssverticalalign" if (onclick= ") value== ' value= '; > <option selected> selection </option> <option value= "Middle" >middle</option> <option value = "Bottom" >bottom</option> <option value= "Auto" >top</option> <option value= "AUT"O ">auto</option> <option value=" baseline ">baseline</option> </select> Purge: <select name = "Vcssclear" id= "Vcssclear" onclick= "if (value==") value= ' both '; > <option selected> Select </option> <option value= "left" >left</option> <option value= "Ri Ght ">right</option> <option value=" Both ">both</option> </select> Overflow:<select Nam E= "Vcssoverflow" id= "Vcssoverflow" onclick= "if (value==") value= ' hidden '; > <option selected> selection </option> <option value= "Scroll" >scroll</option> <option value = "Auto" >auto</option> <option value= "hidden" >hidden</option> </select> positioning: <select n Ame= "Vcssposition" id= "vcssposition" > <option selected> Select </option> <option value= "Absolute" > absolutely </option> <option value= "relative" > relative </option> </select> z coordinates: <input name= "Vcsszindex" id= "Vcsszindex"class= "Normal_input" size= "5" value= "onmouseout=" event.cancelbubble=true;this.classname= ' normal_input '; "/> Left:<input name= "Vcssleft" id= "Vcssleft" class= "Normal_input" size= "4" value= ""/> top:<input name= "VcssTop" Id= "Vcsstop" class= "Normal_input" size= "4"/> right:<input name= "vcssright" id= "Vcssright" class= "Normal_input" Size= "4"/> bottom:<input name= "Vcssbottom" id= "Vcssbottom" class= "Normal_input" size= "4"/> ul list: type <sele CT name= "Vcssliststyletype" "id=" Vcssliststyletype "onclick=" if (value== ') value= ' none '; > <option selected> Select </option> <option value= "None" >none</option> <option value= "di SC ">disc</option> <option value=" Circle ">circle</option> <option value=" Square ">square& lt;/option> <option value= "decimal" >decimal</option> </select> images: <input name= " VCSSLISTSTYLEIMAGEBTN "type=" button "id=" vcssliststyleimagebtn "onclick=" VcssliststyleimAge.click (); "value=" ... "> <input name=" vcssliststyleimage "id=" vcssliststyleimage "type=" file "value=" "/> Bit Place: <input type= "Radio" name= "Vcssliststyleposition" value= "Inside" if (onclick=) Vcsspositionresult.value=this.value "> Inside <input type=" Radio "name=" Vcssliststyleposition "value=" Outside " Onclick= "if (this.checked) Vcsspositionresult.value=this.value" > Outside <input type= "Radio" name= "Vcssvisibility" class= "Hiddenobj" id= "unsetposition" onclick= "if (this.checked) vcsspositionresult.value="; "/>x<input name=" Vcsspositionresult "type=" hidden "/>   cursor: <select name=" Vcsscursor "id=" Vcsscursor "onclick=" if (value== ") value= ' pointer '; > <option selected> Select </option> <option value= "Default" > Default </option> <option value= "p Ointer "> Hand </option> <option value=" text > Text </option> <option value= "Move" > Mobile </option& Gt <option value= "Crosshair" >crosshair</option> &LT;option value= "Default" >default</option> <option value= "pointer" >pointer</option> <option Value= "Hand" >hand</option> <option value= "Move" >move</option> <option value= "Help" >help </option> <option value= "Wait" >wait</option> <option value= "text" >text</option> < Option value= "W-resize" >w-resize</option> <option value= "S-resize" >s-resize</option> < Option value= "N-resize" >n-resize</option> <option value= "e-resize" >e-resize</option> </ select> <input name= "Vcssok" type= "button" id= "Vcssok" onclick= "Setselectionwithcss" (1); "value=" OK "> <inp UT name= "vcsscancel" type= "button" id= "Vcsscancel" value= "Cancel" > <input name= "vcssview" button "type=" id= "Onclick=" setselectionwithcss (2); "value=" Application "> <input name=" vcssimport "type=" button "id=" Vcssimport "value=" @ Import ... " > <input name= "vcsssave" type= button "id=" VcsssaVE "value=" Save ... " > <input name= "vcssload" type= button "id=" Vcssload "value=" Loading ... " > <fieldset ><legend> Actual application results are as follows </legend><div id= "Vcsseffect_div" class= "Vcsseffect" > Effect of this rule shows for your at here! [China's most Q little pigeons-favorite lilac] http://xbnz.126.com</div> </fieldset> </p></div></div> <div class= "Detailcssboxmodel" > </div> </div> <pr/> <textarea name= "Csstextvalue" cols= "5" rows= " Id= "Csstextvalue" ></textarea> <input name= "Vcssview" type= "button" id= "Vcssview" onclick= " Window.clipboardData.setData (' text ', document.all.cssTextValue.value); alert (' CSS saved to clipboard '); "value= Copy to clipping > <textarea name= "Csstextvaluecompare" cols= "rows=" "5" id= "Csstextvaluecompare" ></textarea> <input Name= "VcssView2" type= "button" id= "Vcssview" onclick= "Window.clipboardData.setData" (' Text ', Document.all.cssTextValueCompare.value); alert (' CSS saved to clipboard '); "value=" Copy to Shear Panel > <pr/><div class= "VV" id= "VV" contenteditable= "true" > This is a div with a complex style that you can use to get the CSS </div><input type = "button" id= "Vcssview" onclick= "Getselectionwithcss () setselectionwithcss ()" value= "get left div style" > <div > </div><pr/> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.