it's possible to edit the fancybox script and change it to use 'alt'
instead of 'rel' but you have to be aware that the html element 'a'
doesn't support the 'alt' attribute and you won't be able to group
images with anchors (however, there is a bizarre workaround if you
want to group both, a and area tags if you are interested)
this workaround applies for fancybox v.1.2.1
1. edit the jquery.fancybox-1.2.1.js file (no pack version); be sure
you have a backup if you messed it up.
2. look around the line 62 and find this section:
if (!elem.rel || elem.rel == '') {
var item = {href: elem.href, title: elem.title};
if ($(elem).children("img:first").length) {
item.orig = $(elem).children("img:first");
}
opts.itemArray.push( item );
} else {
var subGroup = $(matchedGroup).filter("a[rel=" + elem.rel + "]");
.... etc.
3. if you see carefully, in this section there are 4 'rel' items;
change them for 'alt' so you get:
if (!elem.alt || elem.alt == '') {
var item = {href: elem.href, title: elem.title};
if ($(elem).children("img:first").length) {
item.orig = $(elem).children("img:first");
}
opts.itemArray.push( item );
} else {
var subGroup = $(matchedGroup).filter("a[alt=" + elem.alt + "]");
4. now, in the LAST line of this section, notice the 'a' tag before
the brackets;
change the 'a' tag for 'area' so you get:
if (!elem.alt || elem.alt == '') {
var item = {href: elem.href, title: elem.title};
if ($(elem).children("img:first").length) {
item.orig = $(elem).children("img:first");
}
opts.itemArray.push( item );
} else {
var subGroup = $(matchedGroup).filter("area[alt=" + elem.alt + "]");
5. save your js file and go to your html file
6. activate fancybox for your image map:
<script type="text/javascript">
$(document).ready(function() {
$("area.group").fancybox();
});
</script>
7. add the 'alt' attribute to your area tag
<map id="image" name="image1">
<area class="group" alt="group" shape=".... />
<area class="group" alt="group" shape=".... />
etc ....
</map>
so you have it!
didn't have time to test it in IE6 but I works in IE7