Closed YodaSpow closed 5 years ago
Turns out only Chrome accepts the :before
on the image tag directly. Both Safari and Firefox do not display the tooltip on image Pseudo-elements:
Thinking maybe this should be fixed with wrapping the image in the jquery .wrap
like the below
https://codepen.io/spowart/pen/PxvLpr
Found a superior method using jquery with wrapping the img
tag in a div
with class only when the conditions match on the attribute selector, thus allow Safari and Firefox to add the tool tip to the div
$("img[alt*='£'], [alt*='&'], [alt*='#'], [alt*='alt']").wrap( "<div class='fauxImg'></div>" );
Done.
*Alt tag checking for when images are OFF only.** Contains:
£ &, #, alt
Glow maybe in another color.