I am using the below code to click on an image within the .process class and when clicked the .process-info with toggle class of .process--shown.
This code works; however, it will toggle the class of process--shown for all elements on the page with the class of .process-info;
I only want the element clicked on to acitivate
$(document).ready(function(){
$(".process .process--img").click(function(){
$(".process .process--info").toggleClass("process--shown")
});
$(".process .process--info").click(function(){
$(".process .process--info").toggleClass("process--shown")
});
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…