darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

Disable initial activation #118

Closed hammertimedk closed 9 years ago

hammertimedk commented 10 years ago

I'd like no items to receive the "active" class when the plugin initializes. I tried setting startAt to false in the hopes that might do the trick.

Any hints on how to achieve this?

hammertimedk commented 10 years ago

Welll... Obviously I could to a $el.removeClass("active") on doc load, but I feel a bit dirty doing that, if there is a way to tell Sly not to activate any elements on init .... :O)

darsain commented 10 years ago

Not supported atm :( I know I had some reasons for it, but dunno what they were. It is on a to-do list for next rewrite though.

hammertimedk commented 10 years ago

Ok thanks - I've done my "fix", and the side-effect is that the first element is still active internally in Sly, so when the user clicks it, it does not get the active class reapplied.

I might do a pull request on this on, or just hack the js depending on how much time I have on this project ;)

Thanks for a great plugin BTW - It will be used for the front slider on a major european film talent agency website.

darsain commented 10 years ago

Don't bother. There are a lot of issues with current Sly. It needs a big rewrite which will change a lot of things, so time spent on current version would be time wasted. I remember trying to change this particular thing a few months back and dealing with side effects was too annoying so I just decided to wait with this for a rewrite. Can't give you ETA though. Priority is on paying the bills right now :/

I might patch this if there would be a bounty attached though :)

darsain commented 9 years ago

So commit above implements this. It should work, but I'd actually be surprised if there were no side effects. If some pop up, feel free to reopen.