Reputation: 329
I need this code to take a different size letters - image format such as "jpg and JPG, gif and GIF" etc. Also not to take it, for example, not where ".jpg" at the end of the link, to it for nothing as "jpg.html". It is also possible to add that the exemption did not want to look for domain "imageshack"?
$(document).ready(function() {
$('a.postlink').filter(function() {
return $(this).attr('href').match(/\.(jpg|png|gif|jpeg)/);
}).addClass('lightview');
});
Thanks and sorry for my English.
Upvotes: 0
Views: 190
Reputation: 69915
Try this
$(document).ready(function() {
$('a.postlink').filter(function() {
return $(this).attr('href').match(/\.(jpe?g|png|gif)/i);
}).addClass('lightview');
});
Upvotes: 1