{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/139","labels_url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/139/comments","events_url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/139/events","html_url":"https://github.com/jquery/jquery-mousewheel/issues/139","id":86661936,"number":139,"title":"Several parts of the website to scroll horizontally","user":{"login":"ASTN1","id":12064561,"avatar_url":"https://avatars.githubusercontent.com/u/12064561?v=3","gravatar_id":"","url":"https://api.github.com/users/ASTN1","html_url":"https://github.com/ASTN1","followers_url":"https://api.github.com/users/ASTN1/followers","following_url":"https://api.github.com/users/ASTN1/following{/other_user}","gists_url":"https://api.github.com/users/ASTN1/gists{/gist_id}","starred_url":"https://api.github.com/users/ASTN1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASTN1/subscriptions","organizations_url":"https://api.github.com/users/ASTN1/orgs","repos_url":"https://api.github.com/users/ASTN1/repos","events_url":"https://api.github.com/users/ASTN1/events{/privacy}","received_events_url":"https://api.github.com/users/ASTN1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-09T16:45:10Z","updated_at":"2015-07-15T18:11:38Z","closed_at":"2015-07-15T18:11:38Z","body":"Hi guys,\r\n\r\n\r\nI'm developing my new website and would like to use the wonderful Mousewheel plugin. But can't manage to do it as my website is a bit odd.\r\n\r\nBasically my website is based on a horizontal format, with 3 DIVs:\r\n- DIV 2 and DIV 3 must be scrollable horizontally\r\n- By default, DIV 2 is hidden\r\n- By default, Mousewheel function apply to DIV 3\r\n\r\n![exemple 1](http://nsa38.casimages.com/img/2015/06/11/150611012525205667.png)\r\n\r\n- If the user clicks on 'show DIV 2', the DIV appears, and here comes my problem: I want the mousewheel function to apply on DIV 2, no more on DIV 3.\r\n\r\n![exemple 1](http://nsa37.casimages.com/img/2015/06/11/150611012525323047.png)\r\n\r\nThe basic code is:\r\n\r\n    $('body, html, *').mousewheel(function(event, delta) {\r\n      $(this).scrollLeft -= (delta * 40);\r\n      event.preventDefault();\r\n    });\r\n  \r\nI adaptated it to:\r\n\r\n    $('body, html, *').mousewheel(function(event, delta) {\r\n      if( $('#div2').hasClass('closed')) {\r\n        $('#div3-inner').scrollLeft -= (delta * 40);\r\n      } else {\r\n        $('#div2-inner').scrollLeft -= (delta * 40);\r\n      }\r\n      event.preventDefault();\r\n    });\r\n\r\nBut specifying a div to scroll doesn't seems to work... Any help?\r\n\r\nHere's a JSFiddle: http://jsfiddle.net/L00qqzta/2/"},"comment":{"url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/comments/121698691","html_url":"https://github.com/jquery/jquery-mousewheel/issues/139#issuecomment-121698691","issue_url":"https://api.github.com/repos/jquery/jquery-mousewheel/issues/139","id":121698691,"user":{"login":"dmethvin","id":157858,"avatar_url":"https://avatars.githubusercontent.com/u/157858?v=3","gravatar_id":"","url":"https://api.github.com/users/dmethvin","html_url":"https://github.com/dmethvin","followers_url":"https://api.github.com/users/dmethvin/followers","following_url":"https://api.github.com/users/dmethvin/following{/other_user}","gists_url":"https://api.github.com/users/dmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmethvin/subscriptions","organizations_url":"https://api.github.com/users/dmethvin/orgs","repos_url":"https://api.github.com/users/dmethvin/repos","events_url":"https://api.github.com/users/dmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/dmethvin/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T18:11:38Z","updated_at":"2015-07-15T18:11:38Z","body":"This is better addressed at StackOverflow."}}