I have got a pretty standard slider component which slider UL.
I want to add active classes to only visible elements in viewport. I tried googling but all in vail. Is anyone able to shed some light on this please?
Following is the sliding code:
// get all lists that slider was initialised on
$lists = $(this.container).find('> ul');
// get current left position of list
currentPos = $lists.position().left;
// new left position of list is width of a page times target page number
newLeftPos = currentPos - (530 * (newPageNum-1));