Fixed max-idx for slider

When creating slider max-idx should be count-1 not count
Merge pull request #161 from hesperus22/master

Fixed max-idx for slider