The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
CSS saved & applied when logging in...
Hello!
What I'd like to basically do is have my CSS editable on a page such as this... http://www.porjes.com/borders/ ...and have the preferences saved in a person's VB options. I want to basically make a templet page where people can click on an item and edit the attributes of that item, save their preferences and then have it applied when they log in. I'm also interested in allowing my members to export their CSS style to a master list so they can share what they have created with others. my site is http://www.jabcreations.com |
#2
|
||||
|
||||
---------------
Here is javascript I use to switch style sheets...I'm not a javascript person unfortunitly so I do not know what I could do to mix it up with the script to follow... --------------- var s=document.cookie.split(":"); var v=s[0],f=(s[1])?s[1]:'http:\/\/www.jabcreations.com\/themes\/css-theme-classic.css'; document.write('<link rel="stylesheet" type="text/css" href="'+f+'">\n');//.css">\n'); function switchStyle (n,s){ var x=new Date();x.setTime(x.getTime()+(60*60*24*365)); document.cookie=s+':'+n+':'+';expires='+x.toGMTStr ing()+';path=/'; history.go(0); } --------------- The script to follow is the code to the page I originally linked too.. --------------- bd_clr = '#FFFFFF'; br_clr = '#000000'; dv_clr = '#FFFFDD'; brdr_size = 3; function max(i,j) { return i > j ? i : j; } function bdSize(inx) { if (!document.styleSheets[0]) return; var theRules = new Array(); if (document.styleSheets[0].rules) { theRules = document.styleSheets[0].rules; } else if (document.styleSheets[0].cssRules) { theRules = document.styleSheets[0].cssRules; } else { return; } brdr_size = max(0,brdr_size + inx); theRules[0].style.borderWidth = brdr_size + 'px'; document.getElementById("csize").innerHTML=" " + brdr_size.toString() + "px borders"; } function cswitch(val) { if (!document.styleSheets[0]) return; var theRules = new Array(); if (document.styleSheets[0].rules) { theRules = document.styleSheets[0].rules; } else if (document.styleSheets[0].cssRules) { theRules = document.styleSheets[0].cssRules; } else { return; } var x = checkRadioControl('which'); if (x == 0) br_clr = val; else if (x == 1) bd_clr = val; else dv_clr = val; document.getElementById("clr").innerHTML=" " + br_clr + " borders - " + bd_clr + " body - " + dv_clr + " divs "; theRules[0].style.borderColor = br_clr; theRules[1].style.backgroundColor = bd_clr; theRules[4].style.backgroundColor = dv_clr; } function checkRadioControl(strFormField) { var objFormField = document.forms[0].elements[strFormField] intControlLength = objFormField.length var bolSelected = -1; for (i=0;i<intControlLength;i++){ if(objFormField[i].checked){ bolSelected = i; break; } } if(bolSelected == -1){ alert("Please select one option!"); return 0; }else{ return bolSelected; } } --------------- Anyway, this is the script I've been looking at. Wish I could read it like English :laugh: --------------- |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|