[quote=nisfuaje]bang strezzpc dah saya PM,....tolong bantuan nya yah
[/quote]
Kamu bikin file JS dulu
Ini saya kasih JS yg sederhana dulu dengan fungsi addbox
[spoiler]//BAGIAN A
//css injection
function injectcss() {
if(window.cssinjected == undefined) {
cssinjected = 1;
var css = document.createElement("link");
css.setAttribute("type","text/css");
css.setAttribute("rel","stylesheet");
css.setAttribute("href","URL CSS KAMU");
css.setAttribute("media","screen, print"); document.getElementsByTagName("head")[0].appendChild(css);
}
}injectcss();
//WELCOME ALERT
window.onload= function(){
WelcomeME();
}
function WelcomeME()
{
if (parent.pageViewerFName=="")
{
alert('SELAMAT DATANG');
}
else
{
alert('Hi\n\n'+parent.pageViewerFName+'\n\n ..Hope u enjoy yer time here..');
alert('Yer User ID is >>'+pageViewerID+'<< ');
}
}
//GOODBYE ALERT
function ByeTamu()
{alert('PESAN , '+parent.pageViewerFName+' , PESAN');}
window.onbeforeunload = function ()
{ByeTamu();
};
//onload handler
function onProfileLoad() {
//insert generated boxes here
//BAGIAN B
//Calender
var code="<br><embed pluginspage=\"http://www.adobe.com/go/getflashplayer\" src=\"http://www.yourminis.com/Dir/GetContainer.api?uri=yourminis/yourminis/mini:calendar\" FlashVars=\"height=183&width=210&xheight=193&xwidth=220&dayoffset=0&uri=yourminis%2Fyourminis%2Fmini%3Acalendar&swfurl=%2Fwidget%5Fcalendar%2Eswf&\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" wmode=\"transparent\" width=\"220\" height=\"193\"></embed><br>"+"<embed pluginspage=\"http://www.adobe.com/go/getflashplayer\" src=\"http://www.yourminis.com/Dir/GetContainer.api?uri=yourminis/yourminis/mini:clock\" FlashVars=\"height=100&width=240&xheight=110&xwidth=250&dlsave=0&uri=yourminis%2Fyourminis%2Fmini%3Aclock&swfurl=%2Fwidget%5Fclock%2Eswf&\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" wmode=\"transparent\" width=\"250\" height=\"110\"></embed>"+"<br><div align='center'><form>"+
"Friendster ID : <input type='text' id='txtcekfs' value='' maxlength='8' size='8' /> "+
" <input type='button' id='btncekfs' onclick='cekfs()' value='Proses Cek' />"+
"</form><br /><div id='outputcekfs'></div></div>";
addBox(null,code,"custombox_613","right");
//Moving Friends Box
var marqueeFriends = document.getElementById("content_2").innerHTML;
document.getElementById("content_2").innerHTML ="<marquee direction='up' height='250' scrollamount='2' onMouseOver='stop()' onMouseOut='start()'>"+
marqueeFriends+"</marquee>";
//flash mp3
var header="Muzik";
var code="<object width=\"275\" height=\"310\"><param name=\"movie\" value=\"http://musikfs.com/friendster.swf\"></param><param name=\"wmode\" value=\"transparent\"></param>"+"<embed src=\"http://musikfs.com/friendster.swf\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"275\" height=\"310\"></embed></object>";
addBox(header,code,"custombox_488","right");
}
if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()};
/*MISC FUNCTIONS*/
function addBox(head,code,id,siblingafter) {
/*
head:
html string title
null - no header bar
code:
html string content
id:
unique string css pointer
siblingafter:
regexp classname
'left' - mainbar column end
'right' - sidebar column end
*/
try {
var li=document.createElement("li");
} catch(e) {
var li=document.createElement("<li>");
}
if(!head) head="";
else head="<h2>"+head+"</h2>";
li.innerHTML="<div id=\""+id+"\" class=\"commonbox "+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
if(siblingafter=="left") getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else if(siblingafter=="right") getElementsByClass(/commonbox[\s]*?friends/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else {
var si=getElementsByClass(siblingafter,null,"DIV")[0];
si.parentNode.parentNode.insertBefore(li,si.parentNode);
}
}
function processAjaxRequest(type,url,cont,param,handler,handlerparam) {
//by marfillaster
if(handlerparam) handlerparam=","+handlerparam;
else handlerparam="";
var httprequest= window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("Msxml2.XMLHTTP");
if(handler) eval("httprequest.onreadystatechange=function(){if (httprequest.readyState==4) {"+handler+"(httprequest.responseText"+handlerparam+");}}");
httprequest.open( type, url, cont);
if(type=="POST") {
httprequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httprequest.setRequestHeader("Content-length", param.length);
httprequest.setRequestHeader("Connection", "close");
}
httprequest.send(param);
}
function invert(x) {
if(x>0) return parseInt("-"+x);
else if(x<0) {
x=x+"";
return parseInt(x.substr(1,x.length-1));
}
return 0;
}
function randOrd(){
return (Math.round(Math.random())-0.5);
}
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp(searchClass);
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
/*END MISC FUNCTIONS*/
//BAGIAN C
[/spoiler]
Kamu ganti [b]URL CSS KAMU[/b] dengan url css km
Save sebagai file JS
Last edited by strezzpc (2008-05-29 11:37:16)