I am trying to use an 'if' statement to determine which element was clicked.
Basically I am trying to code something along the lines of:
if (the element clicked is '#news_gallery li .over') {
var article = $('#news-article .news-article');
} else if (the element clicked is '#work_gallery li .over') {
var article = $('#work-article .work-article');
} else if (the element clicked is '#search-item li') {
var article = $('#search-item .search-article');
};
What is the proper jQuery syntax for this? Many thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…