Disable FancyBox on certain links

1,307 views
Skip to first unread message

digitalexpl0it

unread,
Apr 15, 2009, 2:30:16 PM4/15/09
to fancybox
Is there a way to disable fancybox to only work on certain links?

When fancybox loads I have this.

$(document).ready(function() {
$("a").fancybox({ 'frameWidth': 600, 'frameHeight': 400,
'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true });
});

But this applies to all <a> tags, I need some <A> tags not have
fancybox attached to it.

digitalexpl0it

unread,
Apr 15, 2009, 5:58:38 PM4/15/09
to fancybox
can I use the id="" tag instead of the a?

digitalexpl0it

unread,
Apr 15, 2009, 6:27:49 PM4/15/09
to fancybox
I had to just add this for it to work.

$("#pop").fancybox({ 'frameWidth': 600, 'frameHeight': 400,
'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true });
$("#pop2").fancybox({ 'frameWidth': 600, 'frameHeight': 400,
'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true });
$("#pop3").fancybox({ 'frameWidth': 600, 'frameHeight': 400,
'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true });

cutout

unread,
May 18, 2009, 9:25:38 PM5/18/09
to fancybox
Is there no way to do this without touching the core js files?
Something more like:

<a rel="nopopup" href="#">asdfa</a>

hutchcj

unread,
Jun 23, 2009, 5:55:39 AM6/23/09
to fancybox
If all else fails, read the instructions...

$(document).ready(function() {
$("a.group").fancybox();
}

Then create your gallery like this:

<a class="group" rel="gallery1" title="Image 1 of 2"
href="image02b.jpg"><img src="image02.jpg"></a>
<a class="group" rel="gallery2" title="Image 2 of 2"
href="image01b.jpg"></a>
<a href="some_other_link.htm">link</a> <!-- This one won't trigger a
fancybox -->

With this setting, "a.group", the fancy box will only appear when the
class is set to "group" in the anchor.

Andreas

unread,
Jun 23, 2009, 9:59:33 AM6/23/09
to fancybox
Is there a way to disable fancybox to only work on certain links?

Of course. I think you just missed the basics, please read on
following pages.

http://docs.jquery.com/How_jQuery_Works#jQuery:_The_Basics
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
http://docs.jquery.com/Selectors

Is there no way to do this without touching the core js files?

Of course yes, there is. Same answer as above, and he didn't touch the
core js files.

Good luck

JFK

unread,
Jun 23, 2009, 2:36:26 PM6/23/09
to fancybox
Reply all
Reply to author
Forward
0 new messages