When the page opens the div with that code, the CSS and backgrounds are messed up, but if you click on the image from the standard example the CSS is just fine. Do either of you guys happen to know why that is?
Here is a screen shot of the problem:
http://www.leohamel.com/fileserver/overlayissue.jpg
Here is the jQuery functions for the rel link as well as the %(window).load that I finally got to work with your help.
$(function() {
$("#apple img[rel]").overlay({effect: 'apple'});
});
$(window).load(function () {
// run code
$("#photo1").overlay({api:true}).load();
});
Here is my CSS, mostly copied from the example:
/* the overlayed element */
.apple_overlay {
/* initially overlay is hidden */
display:none;
/* growing background image */
background-image:url(/images/white.png);
/*
width after the growing animation finishes
height is automatically calculated
*/
width:640px;
/* some padding to layout nested elements nicely */
padding:35px;
/* a little styling */
font-size:11px;
}
/* default close button positioned on upper right corner */
.apple_overlay .close {
background-image:url(/images/close.png);
position:absolute; right:5px; top:5px;
cursor:pointer;
height:35px;
width:35px;
}
/* black version of the overlay. simply uses a different background image */
div.apple_overlay.black {
background-image:url(http://static.flowplayer.org/tools/img/overlay/transparent.png);
color:#fff;
}
div.apple_overlay h2 {
margin:10px 0 -9px 0;
font-weight:bold;
font-size:14px;
}
div.black h2 {
color:#fff;
}
#apple {
margin-top:10px;
text-align:center;
}
#apple img {
background-color:#fff;
padding:2px;
border:1px solid #ccc;
margin:2px 5px;
cursor:pointer;
-moz-border-radius:4px;
-webkit-border-radius:4px;
}
<!--[if lt IE 7]>
div.apple_overlay {
background-image:url(http://static.flowplayer.org/tools/img/overlay/overlay_IE6.gif);
color:#fff;
}
/* default close button positioned on upper right corner */
div.apple_overlay div.close {
background-image:url(http://static.flowplayer.org/tools/img/overlay/overlay_close_IE6.gif);
}
<![endif]-->