{"action":"created","issue":{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1843","repository_url":"https://api.github.com/repos/alvarotrigo/fullPage.js","labels_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1843/labels{/name}","comments_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1843/comments","events_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1843/events","html_url":"https://github.com/alvarotrigo/fullPage.js/pull/1843","id":135298262,"number":1843,"title":"add offset for top","user":{"login":"matgargano","id":197298,"avatar_url":"https://avatars.githubusercontent.com/u/197298?v=3","gravatar_id":"","url":"https://api.github.com/users/matgargano","html_url":"https://github.com/matgargano","followers_url":"https://api.github.com/users/matgargano/followers","following_url":"https://api.github.com/users/matgargano/following{/other_user}","gists_url":"https://api.github.com/users/matgargano/gists{/gist_id}","starred_url":"https://api.github.com/users/matgargano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matgargano/subscriptions","organizations_url":"https://api.github.com/users/matgargano/orgs","repos_url":"https://api.github.com/users/matgargano/repos","events_url":"https://api.github.com/users/matgargano/events{/privacy}","received_events_url":"https://api.github.com/users/matgargano/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-22T02:51:24Z","updated_at":"2016-02-22T11:01:24Z","closed_at":"2016-02-22T11:01:24Z","pull_request":{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/pulls/1843","html_url":"https://github.com/alvarotrigo/fullPage.js/pull/1843","diff_url":"https://github.com/alvarotrigo/fullPage.js/pull/1843.diff","patch_url":"https://github.com/alvarotrigo/fullPage.js/pull/1843.patch"},"body":"I ran into an issue where scrolling to sections wasn't working as I had wanted to because of other elements on the page... (see screenshot) I added a functional callback (also accepts an integer) for the value offset... functional parameters allow for on the fly calculations (e.g. different offsets at different breakpoints)...\r\n\r\n<img width=\"1171\" alt=\"screenshot 2016-02-21 21 49 36\" src=\"https://cloud.githubusercontent.com/assets/197298/13208289/4bed70ce-d8e5-11e5-84f9-9cbc2f23faec.png\">\r\n\r\n\r\nthe way it can be used is:\r\n\r\n```\r\n  $('#fullpage').fullpage({\r\n        menu: '#menu',\r\n        autoScrolling: false,\r\n        fitToSection: false,\r\n        offset: function () {\r\n            var heightOffset = -60;\r\n            if ($(document).width() < 1000) {\r\n                heightOffset = -10;\r\n            }\r\n            return heightOffset;\r\n        }\r\n    });\r\n```\r\n\r\n\r\nor\r\n\r\n```\r\n  $('#fullpage').fullpage({\r\n        menu: '#menu',\r\n        autoScrolling: false,\r\n        fitToSection: false,\r\n        offset: 20\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/comments/187124764","html_url":"https://github.com/alvarotrigo/fullPage.js/pull/1843#issuecomment-187124764","issue_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1843","id":187124764,"user":{"login":"alvarotrigo","id":1706326,"avatar_url":"https://avatars.githubusercontent.com/u/1706326?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarotrigo","html_url":"https://github.com/alvarotrigo","followers_url":"https://api.github.com/users/alvarotrigo/followers","following_url":"https://api.github.com/users/alvarotrigo/following{/other_user}","gists_url":"https://api.github.com/users/alvarotrigo/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarotrigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarotrigo/subscriptions","organizations_url":"https://api.github.com/users/alvarotrigo/orgs","repos_url":"https://api.github.com/users/alvarotrigo/repos","events_url":"https://api.github.com/users/alvarotrigo/events{/privacy}","received_events_url":"https://api.github.com/users/alvarotrigo/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T11:01:24Z","updated_at":"2016-02-22T11:01:24Z","body":"Not quite sure what's the purpose of it. Can you explain your situation in another way? (and ideally with an example in jsfiddle or codepen)\r\n\r\nThe plugin already provides `paddingTop` and `paddinBottom` options for cases in which you want to use a header or a footer. Any element outside the plugin's wrapper has to be fixed positioned. \r\n\r\nI'll close the pull request anyway  because as detailed [in the docs](https://github.com/alvarotrigo/fullPage.js/wiki/Contributing-to-fullpage.js), pull requests should be made to the `dev` branch. "}}