|
Post by bass5098 on Mar 26, 2007 14:47:52 GMT -5
This will make it so you wan have different widths for different skins
Global Header
<script type="text/javascript"><!-- var wid1 = "width" // the width for skin number 1 var wid1-2 = "width" // the width for skin number 1 but -200 var wid2 = "width" // the width for skin number 2 var wid2-2 = "width" // the width for skin number 2 but -200
if(pb_skinid=="1"){ document.write("<style type="text/CSS">body table tr td table.bordercolor, body table.bordercolor {width: '+wid1+';}blockquote table.bordercolor, td.windowbg table tr td table.bordercolor, td.windowbg2 table tr td table.bordercolor {width: '+wid1-2+'px !important;}</style><div align="center" style="align: center;"><div style="width: '+wid1+'px;" width="'+wid1+'">"); } else if(pb_skinid=="2"){ document.write("<style type="text/CSS">body table tr td table.bordercolor, body table.bordercolor {width: '+wid2+';}blockquote table.bordercolor, td.windowbg table tr td table.bordercolor, td.windowbg2 table tr td table.bordercolor {width: '+wid2-2+'px !important;}</style><div align="center" style="align: center;"><div style="width: '+wid2+'px;" width="'+wid2+'">"); //--> </script>
Global Footer
<script type="text/javascript"> <!--
if(pb_skinid=="1"){ document.write("</div>"); } else if(pb_skinid=="2"){ document.write("</div>"); //--> </script>
|
|
|
Post by dberg20 on Mar 27, 2007 22:14:48 GMT -5
Why not reuse functions? And especially why write a conditional for an end tag, while it is the same in both versions.
I'm not testing it, but if I don't have any syntax it will work just the same but cleaner and less buggy than yours.
<script type="text/javascript"> <!--
//Different Skin Width's by Devin //Copyright Sans Pareil @ PB 102
table = document.getElementsByTagName("table");
function resizeWidth(sId, sWd){
if(pb_skinid == sId){
for(r=0; r<table.length; r++){
if(table[r].width == "92%"){
table[r].width = sWd;
}
}
}
}
resizeWidth("1","700");
//--> </script>
May have errors, I'll test.
Edit: Works fine.
|
|