I am using some nice plugins from jQuery for using AJAX based sites. Now I came to the problem that I would like to use livequery for specifying my slimbox. The problem is, that it doesn't get my groups as stated in the linkFiler function.
$(document).ready(function ()
{
$('a[rel^="lightbox"]').livequery(function()
{
$(this).slimbox(null, function(el) // link mapper
{
return [el.href, el.title + '<br/><a href=\"' + el.href + '\">Download</a>'];
}
, function(el) // links filter
{
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
});
});
What's going wrong? In one of my pages (Biography), the slimbox only works when I refresh the page on that site, but not when clicking through my pages. The groups aren't working in the Discography section of the site.
Parts of the bio and discography pictures are as follows:
<a href="albumCover.jpg" rel="lightbox-disco"><img src="albumCover_thumb.jpg" alt=""></a>
<a rel="lightbox" href="bandPic.png"><img style="float:right;margin-left:1em;" src="bandPic_thumb.png" alt=""></a>
Thanks in advance!
UPDATE
I found my problem in the slimbox code, because it uses the this
to be its links. So everytime livequery is fired, the this
is overwritten and should actually contain the full selector. Maybe I can solve this by just saying:
$('a[rel^="lightbox"]').livequery(function()
{
$('a[rel^="lightbox"]').slimbox(null, function(el) // link mapper
...
But doing that would make livequery fire a lot of times towards slimbox, which is not wanted behaviour. Is there a nicer way to make it not fire so often?
UPDATE2
As for the other questio in the biography pages. livequery updates on removing the image, but all the other sites are done properly on adding the images... How strange...