javascript - JQuery selector with both a selector and not-selector -
i have following jquery function:
$('article.node--article p, .video-title').highlightwordandscroll({ words : search_word, tag : '<span class="found_keyword">', closingtag : '</span>', }, scrollto);
which wraps class found_keyword
around search_word
. nothing more. between <p>
tags <img>
tags. , because found_keyword
class wrapped around image name, image isn't rendered anymore.
<p class="rtecenter"> <img alt="" src="/sites/default/files/userfiles/logo_<span class=" found_keyword"="">foto.jpg" style="height:87px; width:332px"> </p>
and so, image-rendering broken. there way exclude image tag in jquery selector?
edit
link. i've tried following code, no luck there...
$('article.node--article p, .video-title').children().not("img").highlightwordandscroll({ words : search_word, tag : '<span class="found_keyword">', closingtag : '</span>', }, scrollto);
why don't more jquery remove classes after, img tags only
Comments
Post a Comment