Identify a specific image, upload, then do something ...
I'm slowly pondering JS / Jquery and I need help / guidance on detecting when a "specific" image is "visible" so I can remove the class on another element. I'm just sure ... just trying to figure out the logic.
JS. ...
$('.my-big-hero').find('my-image-here.jpg:visible').removeClass('class-i-want-removed');
This is probably an easy (and wrong way) to display this, but it should give you an idea of ββwhat I am trying to achieve. I've tried different ways to write this and not win.
Appreciate any help you can give .... thanks in advanced.
source to share
You can use functions .is("visible")
and toggleClass
thus:
$('.my-big-hero').find('my-image-here.jpg').toggleClass('class-i-want-removed', !$(this).is(':visible'));
Then the element will have a class class-i-want-removed
if it is not visible, and the class will be removed after it is visible.
source to share