Refactored addClass() and removeClass() to use jQuery's $.addClass() and
$.removeClass()
This commit is contained in:
@@ -202,7 +202,7 @@ function refreshNavigation() {
|
|||||||
function addClass(element, classname)
|
function addClass(element, classname)
|
||||||
{
|
{
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
element.className += ' ' + classname;
|
$("#"+element).addClass(classname);
|
||||||
//alert('set class: ' + classname + ', now: ' + element.className);
|
//alert('set class: ' + classname + ', now: ' + element.className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,9 +213,7 @@ function addClass(element, classname)
|
|||||||
function removeClass(element, classname)
|
function removeClass(element, classname)
|
||||||
{
|
{
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
element.className = element.className.replace(' ' + classname, '');
|
$("#"+element).removeClass(classname);
|
||||||
// if there is no other class anem there is no leading space
|
|
||||||
element.className = element.className.replace(classname, '');
|
|
||||||
//alert('removed class: ' + classname + ', now: ' + element.className);
|
//alert('removed class: ' + classname + ', now: ' + element.className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user