Shadowbox and domready event
Posted: 11 Dec 2008, 01:26
Firstly I just wanted to say Phoca Gallery is really great and has suited my needs for a personal blog/photo site perfectly. Keep up the great work. I had finished my site but during testing I noticed that if I clicked on an image too quickly shadowbox would not load but instead the image would open on a blank page. When I waited for the page to load shadowbox would load normally.
On viewing the output of my webpage I noticed Shadowbox is being called with the window.onload function see below:
I want to be able to use the domready event instead. I am hoping the code below would do the trick??
My question is where in the phoca gallery component can I change this, which php/js file is this coming from? I would also like to load additional shadowbox players, my guess is it is in the same php file? Any help would be greatly appreciated.
On viewing the output of my webpage I noticed Shadowbox is being called with the window.onload function see below:
Code: Select all
<script type="text/javascript">
Shadowbox.loadSkin("classic", "/components/com_phocagallery/assets/js/shadowbox/src/skin");
Shadowbox.loadLanguage("en", "/components/com_phocagallery/assets/js/shadowbox/src/lang");
Shadowbox.loadPlayer(["img"], "/components/com_phocagallery/assets/js/shadowbox/src/player");
window.onload = function(){
Shadowbox.init();
}
</script>Code: Select all
<script type="text/javascript">
Shadowbox.loadSkin("classic", "/components/com_phocagallery/assets/js/shadowbox/src/skin");
Shadowbox.loadLanguage("en", "/components/com_phocagallery/assets/js/shadowbox/src/lang");
Shadowbox.loadPlayer(["img"], "/components/com_phocagallery/assets/js/shadowbox/src/player");
window.addEvent('domready', function() {
Shadowbox.init();
}
</script>