Hi Mark!

> Ive got a simple bit of jQuery that takes the href from an ancor tag and 
> passes it on:
> 
> $(".jShow a img").hide().attr({"src": $(this).attr("href"), "title": 
> $(this).attr("title")});
> 
> How do i go about adding to the $(this).attr("href") part, i wish to add 
> -large to it before the file extension

Try this:
$(".jShow a img").hide().attr({"src": $(this).attr("href").replace(/\.(.+)$/, 
"-large.$1"), "title": 
$(this).attr("title")});

Tested with "javascript.txt" as href value, works fine.

-- Jörn
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to