hmph ... sorry about the typos! Must get into the habit of actually wearing my glasses!
On May 24, 4:46 pm, leggo-my-eggo <[EMAIL PROTECTED]> wrote: > Wizzud, > > So helpful, thank you! > > Just to have the record here complete, there were two small syntax > things in that that I had to change, and the working version is: > > jQuery('.entry a:not(.download):has( img )') > .filter(function(){ return /\.(jpg|gif|png)$/.test(this.href); > }).attr('rel','popupgallery').addClass('something'); > > The two changes are the closing of the single quote and paren at the > end of the selector, and changing this.ref to this.href > > Works perfectly! > > On May 24, 6:42 am, Wizzud <[EMAIL PROTECTED]> wrote: > > > jQuery('.entry a:not(.download):has( img ) > > .filter(function(){ return /\.(jpg|gif|png)$/.test(this.ref); > > }).attr('rel','popupgallery').addClass('something'); > > > On May 24, 12:55 am, leggo-my-eggo <[EMAIL PROTECTED]> wrote: > > > > Hi, I'm new here, so forgive me if I'm missing something obvious, or > > > violating etiquette. > > > > I'm trying the following code: > > > > jQuery('.entry a:has( img )[href$={".jpg" || ".gif" || > > > ".png"}]').not('.download').attr('rel', > > > 'popupgallery').addClass('something'); > > > > What I want it to do is to find in .entry all the <a> tags with <img>s > > > inside them, but I only want <a> tags with href attributes whose > > > values end in .jpg, .gif, or .png. And I want only those <a> tags > > > which do not have a class of 'download'. > > > > So, in other words I want to find all the links that link to a larger > > > version of the image they contain (so, for instance a thumbnail which > > > links to a larger version). > > > > It works except for the {".jpg" || ".gif" || ".png"} bit. How do I > > > check the href value against multiple possibilities? > > > > Thanks!