{"action":"created","issue":{"url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/1320","repository_url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2","labels_url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/1320/labels{/name}","comments_url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/1320/comments","events_url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/1320/events","html_url":"https://github.com/OwlCarousel2/OwlCarousel2/issues/1320","id":148241037,"number":1320,"title":"how to get current position of the stage?","user":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-14T03:27:15Z","updated_at":"2016-04-14T19:28:39Z","closed_at":null,"body":"My task is to add a class to the two outermost `owlItems` in the below photo:\r\n\r\n![img](http://puu.sh/ohtxm/68cff97847.png)\r\n\r\nMy idea was to iterate `owl._items` and check if the `left offset` is less than the current offset of the stage, or if the `left offset + item.width` is greater than the left offset + width of the browser. is there a property i can use to get the current scroll position of the stage?"},"comment":{"url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/comments/210111892","html_url":"https://github.com/OwlCarousel2/OwlCarousel2/issues/1320#issuecomment-210111892","issue_url":"https://api.github.com/repos/OwlCarousel2/OwlCarousel2/issues/1320","id":210111892,"user":{"login":"r3wt","id":4483325,"avatar_url":"https://avatars.githubusercontent.com/u/4483325?v=3","gravatar_id":"","url":"https://api.github.com/users/r3wt","html_url":"https://github.com/r3wt","followers_url":"https://api.github.com/users/r3wt/followers","following_url":"https://api.github.com/users/r3wt/following{/other_user}","gists_url":"https://api.github.com/users/r3wt/gists{/gist_id}","starred_url":"https://api.github.com/users/r3wt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3wt/subscriptions","organizations_url":"https://api.github.com/users/r3wt/orgs","repos_url":"https://api.github.com/users/r3wt/repos","events_url":"https://api.github.com/users/r3wt/events{/privacy}","received_events_url":"https://api.github.com/users/r3wt/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T19:28:39Z","updated_at":"2016-04-14T19:28:39Z","body":"So, i was able to accomplish this, atleast `onInitialized` it works.\r\n\r\n```js\r\n\tvar greyItems = function(e){\r\n\t\tvar j = $('.blog-slider').find('.owl-item.active');\r\n\t\tj.eq(0).prev().addClass('greyed');//left outermost item\r\n\t\tj.eq( j.length - 1 ).addClass('greyed');//right outermost item\r\n\t};\r\n\t\r\n\t$('.blog-slider').owlCarousel({\r\n\t\tcenter: true,\r\n\t\titems:2,\r\n\t\tloop:true,\r\n\t\tmargin:20,\r\n\t\tresponsive:{\r\n\t\t\t600:{\r\n\t\t\t\titems:4\r\n\t\t\t}\r\n\t\t},\r\n\t\tonInitialized: greyItems,\r\n\t\tonDrag:function(e){\r\n\t\t\tconsole.log('drag start');\r\n\t\t\t$('.owl-item').removeClass('greyed');\r\n\t\t},\r\n\t\tonDragged:greyItems\r\n\t});\r\n```\r\n\r\nWhen it fires for `onDragged` something crazy happens. random divs are grayed out instead of the expected two outermost divs."}}