I am having a submenu made with an Ul Li. When you display the sub menu, the li are shown without any border.
With a simple javascript code, when you click on a li I do this :
.actif-link {
border: 1px solid rgb(173, 178, 178);
padding: 5px;
}
About JS :
$("ul.filter-ul > li > label > a").on("click", function(event) {
event.preventDefault();
$this = $(this);
if ($this.hasClass("actif-link")) {
$this.removeClass("actif-link");
} else {
$this.addClass("actif-link");
}
});
Well. The problem is that my items are aligned this way :
item1-item2-item3
Imagine I click on the first item, when I add my class (with the border + inner padding) I have this :
item1--item2-item3
The clicked item move.
This is really troublesome and I don't find a way to solve it actually.
Should I put each item in a DIV with a fix width and apply the border to the width ? Is there no other way ?
I thank you in advance for the time spent on my request.