javascript - Match part of img src when comes into dom and add a class to a <p> tag that matches - jquery -
I have found an AJAX loaded image gallery that loads an image to the dome and then removes it and loads in the next one Does and swirls in that way
Inside the image, I get a list of static names for images (they are on page load and do nothing).
What do I want to do, as the image has been loaded into the DOM, I want to match it with the name of the name of the name of the name / category of the source / source of Reliance SRL.
The desired result is that as soon as the image is displayed, its name is underlined and then when it goes, its name is no longer underlined because the next picture names are now underlined ...
I am doing if someone can show me how to do this, then I will be really grateful to bloody!
Thank you!
You can use jQuery's .load ()
method ( For more precise, load events
images such as
$ ('# imageid') .load (function) {// image var myrr = $ (this ) .attr ('src') was loaded; if (mySrc.indexOf ('some_string_identifier')); gt; {$ (this) .addClass ('underline');}});
You can call .od ()
at window object
. This is removed when all the images (such as waiting for some other things like iframes
are also loaded as side effects) are loaded.
$ (window) .load (function () {});
And fix your inquiry.
Comments
Post a Comment