How to highlight clicked div?
var highlight = 'v_highlight';
var $cols = $('#vTable1 tr:not(:eq(0))').click(function() {
$cols.removeClass(highlight);
$(this).addClass(highlight);
$('#v_LegalMoreView').fadeIn();
smoothScroll(document.getElementById('v_LegalMoreView'));
var $cols = $('#vTable1 tr:not(:eq(0))').click(function() {
$cols.removeClass(highlight);
$(this).addClass(highlight);
$('#v_LegalMoreView').fadeIn();
smoothScroll(document.getElementById('v_LegalMoreView'));
});
2nd Example==>
HTML-->
Thumb1
</div>
<div class="divs">
Thumb1
</div>
<div class="divs">
Thumb1
</div>
<div class="divs">
Thumb1
</div>
CSS-->
.color {
background-color: yellow;
}
JS-->
var Acolor = 'color';
var $cols = $('.divs').click(function(e) {
$cols.removeClass(Acolor);
$(this).addClass(Acolor);
});
Comments
Post a Comment