There have been already several posts inquiring how to fire fancybox from any html tag other than , like
, or input buttons for instance. The reasons in doing this are different but many just simply don't want to show the target URL when the mouse is over the link. The most common approach is using the javascript event "onclick". Here it is a simply way to achieve this: 1). No changes in your fancybox script, use the one you know: 2). you still need an to fire it up. "BUT YOU SAID ...", I know, but actually we need to set where the content will be taken from so: or or whatever your target is this link can be hidden though so no risk to click on it:
or tag (without href of course): open fancybox with anchor but not href wanna use an image or button?: open fancybox SO NOW SUPPOSE YOU WANT TO LAUNCH A GALLERY just add the same 'rel' attribute to all elements of the gallery and launch it (i.e. from a thumbnail) with the following code: open fancybox NOTICE that we added ':first' to 'a.fancygallery' read more: http://groups.google.com/group/fancybox/browse_thread/thread/fb28cda3... and of course we'll need the elements of the gallery:
is it too obvious if we mention that we need the following script?: $("a.fancygallery").fancybox(); well, just in case :) Tested with FF, IE7, Opera, Chrome and Safari I don't see why it wouldn't work in IE6