Greasy Fork is available in English.

§
Δημοσιεύτηκε: 19/03/2015

convert gif to url

hello, so i have this http://jsfiddle.net/4q2tjLg3/

pic
ÎnchideЗакрыть

how to convert the gif to url, to change image src to text link, please and thank you

§
Δημοσιεύτηκε: 19/03/2015
Επεξεργάστηκε: 19/03/2015

so instead of gif it will show only url like this
http://zamolxismd.org/m/forgifs.com/gallery/d/221051-2/Girl-picture-poses.gif

woxxomΣυντονιστής
§
Δημοσιεύτηκε: 19/03/2015

Since you like jQuery, something like this:

$('img.undefined[src*=".gif"]').each(function() {
    $(this).replaceWith('<a href="' + this.src + '">' + this.src + '</a>');
});
§
Δημοσιεύτηκε: 19/03/2015
Επεξεργάστηκε: 19/03/2015

thank you again! one more question please, if the image in link contains words /pic/smilies/ , how can i exclude this image not be transformed in link?

woxxomΣυντονιστής
§
Δημοσιεύτηκε: 20/03/2015

Simply add if (this.src.indexOf('/pic/smilies/') < 0) at the start of line 2.

§
Δημοσιεύτηκε: 20/03/2015

thank you, working cool!

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.