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
2010-07-05 09:28:10
thank you very much
moustafa
2010-07-05 09:31:33
Why are you using getElementById? You can do the same in jQuery by simply using if($("#popup").length) {} :)
Marko
2010-07-05 09:33:42
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
2010-07-05 09:50:36
A:
Yes you can like so
$(document).ready(function(){$.facebox($(your_selecor_here);});
Avi Tzurel
2010-07-05 09:29:12