$(document).ready is like onload. Except images might not be fully loaded yet. Try:
Code:
$(document).ready(function() {
$("a[rel]").overlay();
$("a[rel]").eq(0).click();
});
That will activate the first a tag with a rel. If you have more than one, you may choose which one by using its zero based index. Like the second one would be eq(1), the third eq(2) and so on.
If you want to wait a little longer, but there is still no guarantee that your display none image will be loaded (this only matters if there are images in the overlay):
Code:
$(window).load(function() {
$("a[rel]").overlay();
$("a[rel]").eq(0).click();
});
If you have just one, as azoomer says, it might work to just change the display property in the css to block as he suggests.
Bookmarks