cobain kode ini broth buad js kmu.
[quote]if (!attachOnLoadHandler(function() { loadJS();})) { window.onload = function() { loadJS();};}
function loadJS() {
THEME.init();
}
if (typeof THEME == "undefined") { THEME = {}; }
THEME = {
theme: [],
init: function() {
var dCSS ="[b]URL CSS ASLI[/b]";
var tCSS1 ="[b]URL CSS 1[/b]";
var tCSS2 ="[b]URL CSS 2[/b]";
var tCSS3 ="[b]URL CSS 3[/b]";
/* load for Firefox, Opera + Safari */
var css=document.createElement("link");
css.rel="stylesheet";css.href=dCSS;css.title="defaultstyle";
document.getElementsByTagName("head")[0].appendChild(css);
/* switch layout */
var css1=document.createElement('link');
css1.rel="stylesheet";css1.href=tCSS1;css1.title="1";
document.getElementsByTagName('head')[0].appendChild(css1);
var css2=document.createElement("link");
css2.rel="stylesheet";css2.href=tCSS2;css2.title="2";
document.getElementsByTagName('head')[0].appendChild(css2);
var css3=document.createElement("link");
css3.rel="stylesheet";css3.href=tCSS3;css3.title="3";
document.getElementsByTagName("head")[0].appendChild(css3);
/* load for IE */
var css4=document.createElement("link");
css4.rel="stylesheet";css4.href=dCSS;css4.title="defaultcss";
document.getElementsByTagName('head')[0].appendChild(css4);
try {
this.theme = document.createElement("div");
}catch (e) {
this.theme = document.createElement("<div>");
}
this.theme = "<input type='button' class='themeButton' value='[b]LAYOUT 1[/b]' onClick=\"THEME.ActivateCSS('1'); return false;\">"+
" <input type='button' class='themeButton' value='[b]LAYOUT 2[/b]' onClick=\"THEME.ActivateCSS('2'); return false;\">"+
" <input type='button' class='themeButton' value='[b]LAYOUT 3[/b]' onClick=\"THEME.ActivateCSS('3'); return false;\">"+
" <input type='button' class='themeButton' value='[b]LAYOUT ASLI[/b]' onClick=\"THEME.ActivateCSS('defaultcss'); return false;\">";
addNewBox.HTML(null,"<div align=\"center\" class=\"boxcontent\">"+this.theme+"</div>","themeswitch",/controlpanel/i,"above");
},
ActivateCSS: function(title) {
var i, link;
for (i = 0;(link = document.getElementsByTagName("link")[i]);i++) {
if (link.getAttribute("rel") != - 1 && link.getAttribute("title")) {
link.disabled = true;
if (link.getAttribute("title") == title) link.disabled = false;
}
}
}
};
if (typeof addNewBox == "undefined") { addNewBox = {}; }
addNewBox = {
//addNewBox v2.2
/*
header: HTML string name
null - no header
x: "above" - HTML string: at the above of sibling box
"below" - HTML string: at the below of sibling box
null - HTML string: at the very bottom of box
sibling:- /controlpanel/i
- /photos/i
- /blogs/i
- /reviews/i
- /moreabout/i
- /publiccomments/i
- /scrapbook/i
- /meettrail/i
- /friends/i
- /ads/i
- /fanof/i
- /groups/i
*/
li: [], ul: [],
HTML: function(head,code,id,sibling,x) {
this.li = document.createElement("LI");
if (!head) head = "";
else head = "<h2>"+head+"</h2>";
this.li.innerHTML = "<div class=\"commonbox "+id+"\" id=\""+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
if (!x) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(this.li);
else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(this.li);
else if (x == "above") {
this.ul = this.getModuleByClassName(sibling)[0];
this.ul.parentNode.parentNode.insertBefore(this.li,this.ul.parentNode);
}
},
getModuleByClassName: function(sClass) {
var elm = [];
var els = document.getElementsByTagName("*") || document.all;
for (var j=0,k=els.length;j<k;j++) {
if (new RegExp(sClass).test(els[j].className))elm.push(els[j]);
}
return elm;
}
};[/quote]
ganti URL nya.
kamu juga bisa ganti text buad yg di button nya.
smoga berhasil broth.
Last edited by andHa (2007-12-02 14:51:45)