I have a third party JQuery library that does this:
var $this = $(this);
...
var $items = $this.find('a');
...
$items.attr('rel', opts.group).fancybox(opts.fancybox);
The last line adds the rel attribute to links in my page and makes a fancybox pop up when I click on the link. I wanted to stop this from happening and noticed that by commenting out the last line I get a prompt to download the file that the link points to – this is exactly what I want. Problem is that I can’t just comment out this line since if I upgrade this library in the future then I will have problems with keeping the library updated with my changes. So I thought that if I remove the rel attributes inline that the fancy box will not pop up. I was able to remove the rel tags but for some reason the fancy box still pops up. Any idea what code I need to write to get rid of the fancy box and get the prompt for downloading the file?
Thanks,
Sachin
Try to think about the chronological order in which the actions are executed.
Perhaps the code that initiates fancybox comes after the code you use to remove it.
Try executing your code only when the document is ready, thus making sure it is executed after any external library is loaded.
for example: