在单击或鼠标悬停时为图像添加边框

时间:2012-05-16 07:04:27

标签: javascript jquery css asp.net-charts

我想在地图上为选定的图像区域添加圆形边框,我该怎么办?

4 个答案:

答案 0 :(得分:2)

您可以使用jQuery:

$('body').on('click', 'img', function() {
    $(this).addClass('with-round-corners');
});

答案 1 :(得分:0)

您可以使用CSS

img{
    border:none;
}
img:hover{
    border:1px solid;
}

答案 2 :(得分:0)

img
{
border:0px;
}
img:hover
{
border:1px solid black;
border-radius:5px;
}

答案 3 :(得分:0)

点击时使用以下JQuery代码:

$(imageAreasSelector).css({ 'border': '1px solid Red' });
$(imageAreasSelector).css({ 'border-radius': '5px' });
相关问题