views:

20

answers:

1
$('area').qtip({
    content: $('#whatever-this-area-tags-alt-is'),
    position: {
        my: 'top left',    
        at: 'middle'
    },
    show: { delay: 0 },
    hide: { delay: 200 }
});

I'd like to set content ID to whatever the current area's alt is.

Thanks!

+1  A: 

You can use a .each() to loop through and use this to refer to the current <area> inside the loop, like this:

$('area').each(function() {
  $(this).qtip({
    content: $("#" + $(this).attr("alt")),
    position: {
        my: 'top left',    
        at: 'middle'
    },
    show: { delay: 0 },
    hide: { delay: 200 }
  });
});
Nick Craver
I don't want to show 'alt' but an element that has the ID same as the alt.
Nimbuz
@Nimbuz - Ah I understand, updated the above :)
Nick Craver
Perrrrfect! Thanks heaps :)
Nimbuz