-1
有没有一种方法来测试您的当前URL位置是否与您网页上的链接相匹配,但是还要检查匹配链接的父母(或祖父母)div是否具有特定的div类?父母和祖父母div类检查
例如 jQuery的(文件)。就绪(函数($){
// find a-href on page with matching current location URL link
jQuery("*").find("a[href='"+window.location.href+"']").each(function(){
// if matching a-href's parent contains class .aaa
// then BBB action
// else if matching a-href's grand-parent contains class .bbb
// then CCC action
})});