1

我想请你帮忙。

我无法从未选择的图像中删除活动链接。

这是代码:

$(function(){
    $(document).ready(function() {
        $(".Nav_thumb a").click(function() {
            $(this).removeClass("active");
            $(this).addClass('active');     
        });
    });
});

html

<div id="pageNav_thumb">
    <div class="Nav_thumb">  
        <a id="img1" href="javascript:();" onClick="ShowVideo(1); return false;"> 
            <img src="img/Press2.jpg" height="79" width="140" />
        </a>
    </div>
    <div class="Nav_thumb">   
        <a id="img2" href="javascript:();" onClick="ShowVideo(2); return false;">
            <img src="img/Working2g.jpg" height="79" width="140" />
        </a>
    </div> 
    <div class="Nav_thumb">   
        <a id="img3" href="javascript:();" onClick="ShowVideo(3); return false;"> 
            <img src="img/Press2.jpg" height="79" width="140" />
        </a>
    </div> 
</div>

CSS

#pageNav_thumb {
    width: 850px;
    max-width: 100%;
    background:url(../img/foot_04.jpg) no-repeat;
    min-width:850px;
    height:210px;
}
.Nav_thumb {margin:30px 0 0 10px; float:left;}
.Nav_thumb  A { display:inline-block; border: 2px solid rgb(51,51,51);}
.Nav_thumb  A:hover { border: 2px solid red; }
.Nav_thumb A:active  { border: 2px solid red;}
.Nav_thumb A:focus {outline:0;}
4

1 回答 1

2

也许像这个演示这样的东西

$(document).ready(function() {
    $(".Nav_thumb a").click(function() {
        $('.Nav_thumb a').removeClass("active");
        $(this).addClass('active');
    }); 
});
于 2013-07-29T20:38:52.417 回答