Refactored addClass() and removeClass() to use jQuery's $.addClass() and

$.removeClass()
This commit is contained in:
ninadsp
2010-05-29 18:59:27 +05:30
parent bd139f2465
commit d195582cf8

View File

@@ -202,7 +202,7 @@ function refreshNavigation() {
function addClass(element, classname)
{
if (element != null) {
element.className += ' ' + classname;
$("#"+element).addClass(classname);
//alert('set class: ' + classname + ', now: ' + element.className);
}
}
@@ -213,9 +213,7 @@ function addClass(element, classname)
function removeClass(element, classname)
{
if (element != null) {
element.className = element.className.replace(' ' + classname, '');
// if there is no other class anem there is no leading space
element.className = element.className.replace(classname, '');
$("#"+element).removeClass(classname);
//alert('removed class: ' + classname + ', now: ' + element.className);
}
}