Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   pop up page ..!!!!! (http://www.programmingforums.org/showthread.php?t=9606)

ASHORY Apr 30th, 2006 3:01 PM

pop up page ..!!!!!
 
while my brother was browsing some thing attracted me .

Please enter this site and see the table , coz when you clicked on the name "tallium" it will open a popup or some thing i dont know its name so i need ti know how can i make that

http://www.imperialmu.com/index.php?op=rankings

Thanks ..

JavaMan Apr 30th, 2006 3:05 PM

I think that site was made from flash.

Sane Apr 30th, 2006 3:24 PM

It doesn't have to be? Click any of the poster's names on the side of this forum. It's essentially the exact same thing.

Here's the javascript for hiding and showing an object:

:

/* GET AN OBJECT */

var objects = new Array();
var type = 0;
if (document.getElementById)
{
    type = 1;
}
else if (document.all)
{
    type = 2;
}
else if (document.layers)
{
    type = 3;
}
function get_object(idname)
{
    if (typeof(objects[idname]) == "undefined")
    {
        if (type == 1)
        {
            objects[idname] = document.getElementById(idname);
        }
        else if (type == 2)
        {
            objects[idname] = document.all[idname];
        }
        else if (type == 3)
        {
            objects[idname] = document.layers[idname];
        }
    }
    return objects[idname];
}

/* HIDE/SHOW AN OBJECT */

function hide(contID)
{
    dynobj = get_object(contID)

    if (dynobj.style.display == "")
    {
        dynobj.style.display = "none";
    }
    else
    {
        dynobj.style.display = "";
    }

    return false;
}


Then you can use that by creating an object:

:

<div id="my_object">This is some content that can toggle hidden/shown</div>

Then finally a link to toggle the object:

:

<a href="#" onclick="hide('my_object')">Hide/Show</a>

If you want the <div> to overlap what's beneath it, you have to do some position: fixed; attribute or something. Do a little research. I've never tried it.

DaWei Apr 30th, 2006 4:05 PM

Why are you browser-sniffing for 'getElementById'?? Really, really, really old model?


All times are GMT -5. The time now is 4:19 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC