
All the Credits to [b]Cip192[/b]

I will just interpret this tweak in Multiply Application Using the Addbox Function...
Image Preview...
[img]http://img254.imageshack.us/img254/3357/58609633cm4.jpg[/img]
Full Code:
[quote]if (!addEvent(function() { onPageLoad();})) { window.onload = function() { onPageLoad();};}
function onPageLoad() {
//existing codes here
var dk="<div id=\"object\"></div>";
addBox("top","<font size=2px>Object Switcher: <A HREF=\"javascript:normal()\">0</A> | <A HREF=\"javascript:one()\">1</A> | <A HREF=\"javascript:two()\">2</A> | <A HREF=\"javascript:three()\">3</A> | <A HREF=\"javascript:four()\">4</A></font>",dk,"DK");
normal();
}
//ADDBOX FOR MULTIPLY
function addBox (type,head,htm,id,sibling) {
//by blurrycloud multiply version 2008-3000
//credits to marfillaster friendster version
//type "top" | "bottoml" | "bottomr" | "siderail"
//head header string
//htm innerHTML string
//id css_id string
/* Available default Siblings
Coming Soon
*/
try {
var br=document.createElement("li");
} catch(e) {
var br=document.createElement("<br>");
}
if(type=="top") {
var ul=document.getElementById("mainbox_1");
htm="<div class='itemboxsub'>"+htm+"</div>";
}
else if(type=="bottomr") {
var ul=document.getElementById("mainbox_4");
}
else if(type=="siderail") {
var ul=document.getElementById("rail");
}
else var ul=document.getElementById("mainbox_3");
br.innerHTML="<br><div id='"+id+"' class='itemboxsub "+id+"'>"+
"<h2>"+head+"</h2>"+
"<div id='content_"+id+"'>"+htm+
"</div>"+
"</div>";
if(sibling==null) ul.appendChild(br);
else {
sibling=document.getElementById(sibling);
ul.insertBefore(br,sibling);
}
}
function normal()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function one()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function two()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function three()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function four()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}[/quote]
replace those red parts in your own arrangement in each objects
note:
dont forget to add--> [b]\[/b] before each quotation of the object you want to put--> [b]\"[/b]
or other way replace double quotation ([b]"[/b]) by single quote ([b]'[/b])

for example in function normal we add a youtube video.
[quote]function normal()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"left\">[b]<object width=\"95%\" height=\"370\"><param name=\"movie\" value=\"http://www.youtube.com/v/V-WVjl5n0JU&rel=1\"></param><embed src=\"http://www.youtube.com/v/V-WVjl5n0JU&rel=1\" type=\"application/x-shockwave-flash\" width=\"80%\"height=\"200\"></embed></object>[/b]</div>";
}
function one()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function two()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function three()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}
function four()
{
ht = document.getElementById("object");
ht.innerHTML="<div align=\"center\">[color=red]objects here,videos,mp3 or images deafult[/color]</div>";
}[/quote]
then after picking up the function put this code below the onloadhandler [b](inside)[/b] code-----> normal();
[quote]function onProfileLoad() {
//existing codes here
[b]normal();[/b]
}[/quote]
Complete Example:
[quote]function onProfileLoad() {
//existing codes here
var dk="<div id=\"object\"></div>";
addBox("top","<font size=2px>Object Switcher: <A HREF=\"javascript:normal()\">0</A> | <A HREF=\"javascript:one()\">1</A> | <A HREF=\"javascript:two()\">2</A> | <A HREF=\"javascript:three()\">3</A> | <A HREF=\"javascript:four()\">4</A></font>",dk,"DK");
[b]normal();[/b]
}[/quote]
That's it your done... Goodluck
[quote][b]FAQ[/b]
Q: Can I change the position of the box?
A: Yes Ofcourse: If you read how to apply the addbox function that i posted on the other thread....
you can change the position of your box
Available positions if your boxes is in default mode....

top

bottoml

bottomr

siderail
Just look for the bod part here

addBox("[b]top[/b]","Object Switcher.........[/quote]
Last edited by blurrycloud (2008-05-17 02:03:29)