My apologies if this is just another question that gets asked over and over. I've found some similar questions, the examples just haven't gotten me exactly where I need to be. This is similar to http://stackoverflow.com/questions/359467.
$('a.highslide').each(function() {
hsGroup = $(this).attr("rel");
if(hsGroup.length > 1){
hsGroup = hsGroup.replace(/\s/g , "-");
}
this.onclick = function() {
return hs.expand(this, { slideshowGroup: hsGroup });
}
});
this code setsup an onclick that launches a highslide popup. I've added the slideshowGroup property and the hsGroup code above it which pulls the contents of the Rel attribute to define the group of each. The issue as you may see right away is the contents of hsGroup is not local to that anon function. So at run time its value is always the same for each link the is applied to. I've looked through some closure examples but have thus far failed to make them work in my situation.
Thanks,