Thanks i shall give that a go now, didnt know about replace() :D

Many thanks

Jörn Zaefferer wrote:

>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
>  
>


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

Reply via email to