Well, I have figured something out… but I still need a litle help. btw. sorry for making a new post.
This is the oryginal shadowbox code:
<script type="text/javascript">
Shadowbox.init({
// skip the automatic setup again, we do this later manually
skipSetup: true
});
window.onload = function () {
// set up all anchor elements with a "test" class to work with Shadowbox
Shadowbox.setup("a.shadowbox", {
player: "html",
title: "Welcome"
});
};
</script>
And the script that should help me to make it work with ajax loaded links was this:
$('.shadowbox').live('click', function() {
Shadowbox.open(this);
return false;
});
But it wasnt helping, so I made this:
$('.shadowbox').live('click', function() {
Shadowbox.setup("a.shadowbox", {
player: "html",
title: "Welcome"
});
Shadowbox.open(this);
return false;
});
And now it’s working but I think this line:
Shadowbox.open(this);
is no more needed there anyways when I delete it, the script works but it need 2 clicks on the link to start, anyone can help me how to optymalize it?
Greetings.
$('.shadowbox').live('click', function() { Shadowbox.setup("a.shadowbox", { player: "swf" }); Shadowbox.open(this); return false; });Thank you Michail the above code working for me when the page loading in ajax.I have display YouTube video in popup window by using Shadowbox Media Viewer plugin and above code in joomla.