{"action":"created","issue":{"url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/337","labels_url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/337/comments","events_url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/337/events","html_url":"https://github.com/janpaepke/ScrollMagic/issues/337","id":86756870,"number":337,"title":"Can offset be set as a percentage?","user":{"login":"kodama78","id":10442650,"avatar_url":"https://avatars.githubusercontent.com/u/10442650?v=3","gravatar_id":"","url":"https://api.github.com/users/kodama78","html_url":"https://github.com/kodama78","followers_url":"https://api.github.com/users/kodama78/followers","following_url":"https://api.github.com/users/kodama78/following{/other_user}","gists_url":"https://api.github.com/users/kodama78/gists{/gist_id}","starred_url":"https://api.github.com/users/kodama78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodama78/subscriptions","organizations_url":"https://api.github.com/users/kodama78/orgs","repos_url":"https://api.github.com/users/kodama78/repos","events_url":"https://api.github.com/users/kodama78/events{/privacy}","received_events_url":"https://api.github.com/users/kodama78/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/janpaepke/ScrollMagic/labels/support","name":"support","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-09T22:35:33Z","updated_at":"2015-12-06T17:46:29Z","closed_at":"2015-06-10T08:10:43Z","body":"Hi, I was just wondering if offset in the trigger elements could be set with an offset set to a percentage rather than a hard pixel number."},"comment":{"url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/comments/162331519","html_url":"https://github.com/janpaepke/ScrollMagic/issues/337#issuecomment-162331519","issue_url":"https://api.github.com/repos/janpaepke/ScrollMagic/issues/337","id":162331519,"user":{"login":"ADTC","id":6047296,"avatar_url":"https://avatars.githubusercontent.com/u/6047296?v=3","gravatar_id":"","url":"https://api.github.com/users/ADTC","html_url":"https://github.com/ADTC","followers_url":"https://api.github.com/users/ADTC/followers","following_url":"https://api.github.com/users/ADTC/following{/other_user}","gists_url":"https://api.github.com/users/ADTC/gists{/gist_id}","starred_url":"https://api.github.com/users/ADTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADTC/subscriptions","organizations_url":"https://api.github.com/users/ADTC/orgs","repos_url":"https://api.github.com/users/ADTC/repos","events_url":"https://api.github.com/users/ADTC/events{/privacy}","received_events_url":"https://api.github.com/users/ADTC/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T17:46:29Z","updated_at":"2015-12-06T17:46:29Z","body":"Instead of using `offset` with a fixed pixel value, if you want percentage, just set it as a number in `triggerHook` (no `offset` required). The percentage of viewport height is measured from the top of the viewport.\r\n\r\n    triggerHook: 0.05 // i.e. 5% \r\n    triggerHook: 0.75 // i.e. 75%\r\n    triggerHook: 0.9 // i.e. 90%\r\n\r\n`onEnter`, `onLeave` and `onCenter` are merely string aliases for `1`, `0`, and `0.5` respectively."}}