tags:

views:

30

answers:

2

this jquery code enable you to show the box when click any specific text now i want it appear in the page start not in click i mean when the page open it appear automatic

+1  A: 
<div id="popup">
    Hello World
</div>

And the script

jQuery(document).ready(function ()
{
    if (document.getElementById("popup") != null) 
    {
        $.facebox($('#popup').html());
    }
}
Alexander
thank you very much
moustafa
Why are you using getElementById? You can do the same in jQuery by simply using if($("#popup").length) {} :)
Marko
Marko, jQuery is slow. If it's a fast universal function that I can easily write, like getElementById, I'd rather use that, than $("# stuff, which is harder to read, slower, harder to type.
Alexander
A: 

Yes you can like so

$(document).ready(function(){$.facebox($(your_selecor_here);});
Avi Tzurel