Click here to Skip to main content
15,919,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there! this Quickbox was written in mostly css which i am not familiar with. I want to make it open on page load,.. now Manfred gave me great help with the other one so i copied the idea by just changing onclick to onload even onpageload instead, but to no avail. Please tell me how to open this quickbox on pageload, thank you

XML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <style>
        .black_overlay{
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index:1001;
            -moz-opacity: 0.8;
            opacity:.80;
            filter: alpha(opacity=80);
        }
        .white_content {
            display: none;
            position: absolute;
            top: 25%;
            left: 25%;
            width: 50%;
            height: 50%;
            padding: 1px;
            border: 1px solid orange;
            background-color: white;
            z-index:1002;
            overflow: auto;
        }
    </style> </head><body><p>!<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a></p><div id="light" class="white_content">! <a href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">X</a></div><div id="fade" class="black_overlay"></div></body></html><script language="javascript">
</script>
Posted

make a page out of the above code(say quickbox.aspx) and then make use html onload method call the javascript to open the page(quixkbox.aspx)

C#
<script language="JavaScript">

function display()
{
        var URL =  "./quickbox.aspx";
        var Name = "popup";
var Fensteroptionen = "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0";
var Breite = 800;
var Hoehe = 600;
window.open(URL, 'Name', Fensteroptionen + ',width=' + Breite + ',height=' + Hoehe);
}
//-->
</script>
</head>
<body onload=display();>
 
Share this answer
 
Comments
Sandeep Mewara 8-May-12 10:25am    
5!
infamousbreed 9-May-12 7:04am    
tushar-2shar i solved this myself by just stripping out some of the <div> code but i will give you the rep points if you tell me how to delay it, as it just fires on page load and i want it to wait a few seconds.. thanx.
by removing this
</div><div id="fade" class="black_overlay">
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900