{"action":"created","issue":{"url":"https://api.github.com/repos/pklauzinski/jscroll/issues/93","repository_url":"https://api.github.com/repos/pklauzinski/jscroll","labels_url":"https://api.github.com/repos/pklauzinski/jscroll/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/pklauzinski/jscroll/issues/93/comments","events_url":"https://api.github.com/repos/pklauzinski/jscroll/issues/93/events","html_url":"https://github.com/pklauzinski/jscroll/issues/93","id":137094625,"number":93,"title":"Is it possible to use a jQuery selector for nextSelector?","user":{"login":"darkred","id":723651,"avatar_url":"https://avatars.githubusercontent.com/u/723651?v=3","gravatar_id":"","url":"https://api.github.com/users/darkred","html_url":"https://github.com/darkred","followers_url":"https://api.github.com/users/darkred/followers","following_url":"https://api.github.com/users/darkred/following{/other_user}","gists_url":"https://api.github.com/users/darkred/gists{/gist_id}","starred_url":"https://api.github.com/users/darkred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkred/subscriptions","organizations_url":"https://api.github.com/users/darkred/orgs","repos_url":"https://api.github.com/users/darkred/repos","events_url":"https://api.github.com/users/darkred/events{/privacy}","received_events_url":"https://api.github.com/users/darkred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-28T20:51:19Z","updated_at":"2016-03-01T02:57:26Z","closed_at":null,"body":"I'm trying to make a userscript for majorgeeks.com.\r\nMy userscript doesn't work (it doesn't append page 2).\r\n\r\nAs you had described me in [here](https://github.com/pklauzinski/jscroll/issues/75#issuecomment-139036352)\r\n> Also, make sure that your nextSelector is just the selector text, and not a jQuery object itself. \r\n\r\n\r\nSo, my code is:\r\n```\r\n$('div.geekycontent').last().jscroll({\r\n    nextSelector: $('.pagelink').last().prev().find('a'),\r\n    contentSelector: 'div.geekycontent, .pagelink',\r\n});\r\n\r\n```\r\n\r\nI believe the problem in my code lies int the `nextSelector`:\r\nthe selector for `nextSelector` that I'm after is the one-before-the-last `.pagelink` in the page.\r\nI ended up using jQuery: ` $('.pagelink').last().prev().find('a'),` because I couldn't select it via CSS (and I think it's not possible without using jQuery).\r\n\r\nHow can I change it to make it work? (is it possible?)\r\n\r\n----\r\n\r\n_For reference, running `$('.pagelink').last().prev().find('a')` in Browser Console results in:_\r\n```\r\nObject { 0: <a>, length: 1, prevObject: Object, context: HTMLDocument → www.majorgeeks.com }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pklauzinski/jscroll/issues/comments/190510802","html_url":"https://github.com/pklauzinski/jscroll/issues/93#issuecomment-190510802","issue_url":"https://api.github.com/repos/pklauzinski/jscroll/issues/93","id":190510802,"user":{"login":"guanzo","id":4676043,"avatar_url":"https://avatars.githubusercontent.com/u/4676043?v=3","gravatar_id":"","url":"https://api.github.com/users/guanzo","html_url":"https://github.com/guanzo","followers_url":"https://api.github.com/users/guanzo/followers","following_url":"https://api.github.com/users/guanzo/following{/other_user}","gists_url":"https://api.github.com/users/guanzo/gists{/gist_id}","starred_url":"https://api.github.com/users/guanzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guanzo/subscriptions","organizations_url":"https://api.github.com/users/guanzo/orgs","repos_url":"https://api.github.com/users/guanzo/repos","events_url":"https://api.github.com/users/guanzo/events{/privacy}","received_events_url":"https://api.github.com/users/guanzo/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T02:57:26Z","updated_at":"2016-03-01T02:57:26Z","body":"You can translate that jquery statement into a selector with `:nth-last-child(n)`. `.pagelink:nth-last-child(2) a`"}}