microtimber / select-box

Automatically exported from code.google.com/p/select-box
0 stars 0 forks source link

Last class is only added to selects with one item #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The "last" class should be added to the last li, however, it is not.

The problem is in this line:
if (i === olen - 1) {
    li.addClass("last");
}

It can be modified to:
if (that.index() === olen - 1) {
    li.addClass("last");
}

as a possible solution.

Original issue reported on code.google.com by rafa...@gmail.com on 27 Jan 2012 at 12:07

GoogleCodeExporter commented 8 years ago
If you only want to do a CSS change, then you can use the CSS :last-child 
pseudo class.

Original comment by kevin.ce...@gmail.com on 26 Apr 2012 at 5:29