{"action":"created","issue":{"url":"https://api.github.com/repos/meandmax/lory/issues/611","repository_url":"https://api.github.com/repos/meandmax/lory","labels_url":"https://api.github.com/repos/meandmax/lory/issues/611/labels{/name}","comments_url":"https://api.github.com/repos/meandmax/lory/issues/611/comments","events_url":"https://api.github.com/repos/meandmax/lory/issues/611/events","html_url":"https://github.com/meandmax/lory/issues/611","id":214678855,"number":611,"title":"returnIndex returns 0 when slides count is not a multiple of slidesToScroll","user":{"login":"RSeidelsohn","id":870515,"avatar_url":"https://avatars0.githubusercontent.com/u/870515?v=4","gravatar_id":"","url":"https://api.github.com/users/RSeidelsohn","html_url":"https://github.com/RSeidelsohn","followers_url":"https://api.github.com/users/RSeidelsohn/followers","following_url":"https://api.github.com/users/RSeidelsohn/following{/other_user}","gists_url":"https://api.github.com/users/RSeidelsohn/gists{/gist_id}","starred_url":"https://api.github.com/users/RSeidelsohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RSeidelsohn/subscriptions","organizations_url":"https://api.github.com/users/RSeidelsohn/orgs","repos_url":"https://api.github.com/users/RSeidelsohn/repos","events_url":"https://api.github.com/users/RSeidelsohn/events{/privacy}","received_events_url":"https://api.github.com/users/RSeidelsohn/received_events","type":"User","site_admin":false},"labels":[{"id":187592985,"url":"https://api.github.com/repos/meandmax/lory/labels/bug","name":"bug","color":"fc2929","default":true},{"id":187592988,"url":"https://api.github.com/repos/meandmax/lory/labels/help%20wanted","name":"help wanted","color":"159818","default":true}],"state":"open","locked":false,"assignee":{"login":"RSeidelsohn","id":870515,"avatar_url":"https://avatars0.githubusercontent.com/u/870515?v=4","gravatar_id":"","url":"https://api.github.com/users/RSeidelsohn","html_url":"https://github.com/RSeidelsohn","followers_url":"https://api.github.com/users/RSeidelsohn/followers","following_url":"https://api.github.com/users/RSeidelsohn/following{/other_user}","gists_url":"https://api.github.com/users/RSeidelsohn/gists{/gist_id}","starred_url":"https://api.github.com/users/RSeidelsohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RSeidelsohn/subscriptions","organizations_url":"https://api.github.com/users/RSeidelsohn/orgs","repos_url":"https://api.github.com/users/RSeidelsohn/repos","events_url":"https://api.github.com/users/RSeidelsohn/events{/privacy}","received_events_url":"https://api.github.com/users/RSeidelsohn/received_events","type":"User","site_admin":false},"assignees":[{"login":"RSeidelsohn","id":870515,"avatar_url":"https://avatars0.githubusercontent.com/u/870515?v=4","gravatar_id":"","url":"https://api.github.com/users/RSeidelsohn","html_url":"https://github.com/RSeidelsohn","followers_url":"https://api.github.com/users/RSeidelsohn/followers","following_url":"https://api.github.com/users/RSeidelsohn/following{/other_user}","gists_url":"https://api.github.com/users/RSeidelsohn/gists{/gist_id}","starred_url":"https://api.github.com/users/RSeidelsohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RSeidelsohn/subscriptions","organizations_url":"https://api.github.com/users/RSeidelsohn/orgs","repos_url":"https://api.github.com/users/RSeidelsohn/repos","events_url":"https://api.github.com/users/RSeidelsohn/events{/privacy}","received_events_url":"https://api.github.com/users/RSeidelsohn/received_events","type":"User","site_admin":false},{"login":"nstanard","id":4204806,"avatar_url":"https://avatars1.githubusercontent.com/u/4204806?v=4","gravatar_id":"","url":"https://api.github.com/users/nstanard","html_url":"https://github.com/nstanard","followers_url":"https://api.github.com/users/nstanard/followers","following_url":"https://api.github.com/users/nstanard/following{/other_user}","gists_url":"https://api.github.com/users/nstanard/gists{/gist_id}","starred_url":"https://api.github.com/users/nstanard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nstanard/subscriptions","organizations_url":"https://api.github.com/users/nstanard/orgs","repos_url":"https://api.github.com/users/nstanard/repos","events_url":"https://api.github.com/users/nstanard/events{/privacy}","received_events_url":"https://api.github.com/users/nstanard/received_events","type":"User","site_admin":false},{"login":"meandmax","id":6309638,"avatar_url":"https://avatars1.githubusercontent.com/u/6309638?v=4","gravatar_id":"","url":"https://api.github.com/users/meandmax","html_url":"https://github.com/meandmax","followers_url":"https://api.github.com/users/meandmax/followers","following_url":"https://api.github.com/users/meandmax/following{/other_user}","gists_url":"https://api.github.com/users/meandmax/gists{/gist_id}","starred_url":"https://api.github.com/users/meandmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meandmax/subscriptions","organizations_url":"https://api.github.com/users/meandmax/orgs","repos_url":"https://api.github.com/users/meandmax/repos","events_url":"https://api.github.com/users/meandmax/events{/privacy}","received_events_url":"https://api.github.com/users/meandmax/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-03-16T11:50:02Z","updated_at":"2018-05-24T13:59:29Z","closed_at":null,"author_association":"NONE","body":"This special use case is currently bugging me - I have varying numbers of slides and I want to hide the next/prev slider buttons when the slides are at the beginning or the end of the list. But **when the total number of slide elements is less than 2 * slidesToScroll** (the number of slides that are visible at once in my case (4 in the example)), **then returnIndex() returns 0**. If there are more than 2 * slidesToScroll but still not an exact multiple of slidesToScroll, then at the end of the scrolling - i.e. when the last slide is reached - returnIndex() returns the previous index.\r\nFor example when I have 4 slides visible and slidesToScroll equals 4, and I have 14 slides, then when the last slide is reached, returnIndex() returns 12 instead of 14.\r\n\r\nI've prepared a codepen for this:\r\n[http://codepen.io/rseidelsohn/pen/OpxGjr](http://codepen.io/rseidelsohn/pen/OpxGjr)\r\n\r\nThis special issue could be resolved by changing \r\n```javascript\r\n/**\r\n * update the index with the nextIndex only if\r\n * the offset of the nextIndex is in the range of the maxOffset\r\n */\r\nif (slides[nextIndex].offsetLeft <= maxOffset) {\r\n    index = nextIndex;\r\n}\r\n```\r\nto\r\n```javascript\r\n/**\r\n * update the index with the nextIndex always\r\n */\r\nindex = nextIndex;\r\n```\r\nbut I haven't figured out under which condition this will break the slider functionality - so far in our project it works all fine."},"comment":{"url":"https://api.github.com/repos/meandmax/lory/issues/comments/391725174","html_url":"https://github.com/meandmax/lory/issues/611#issuecomment-391725174","issue_url":"https://api.github.com/repos/meandmax/lory/issues/611","id":391725174,"user":{"login":"cmoeser","id":2686223,"avatar_url":"https://avatars0.githubusercontent.com/u/2686223?v=4","gravatar_id":"","url":"https://api.github.com/users/cmoeser","html_url":"https://github.com/cmoeser","followers_url":"https://api.github.com/users/cmoeser/followers","following_url":"https://api.github.com/users/cmoeser/following{/other_user}","gists_url":"https://api.github.com/users/cmoeser/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoeser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoeser/subscriptions","organizations_url":"https://api.github.com/users/cmoeser/orgs","repos_url":"https://api.github.com/users/cmoeser/repos","events_url":"https://api.github.com/users/cmoeser/events{/privacy}","received_events_url":"https://api.github.com/users/cmoeser/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T13:59:29Z","updated_at":"2018-05-24T13:59:29Z","author_association":"NONE","body":"Experiencing this issue as well. 'Active' class never gets added to last slide. "}}
{"actor":{"display_login":"cmoeser"}}