{"action":"created","issue":{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1010","labels_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1010/labels{/name}","comments_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1010/comments","events_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1010/events","html_url":"https://github.com/alvarotrigo/fullPage.js/issues/1010","id":57265822,"number":1010,"title":"Destroy all doesn't work on window resize","user":{"login":"peterph-am","id":7984905,"avatar_url":"https://avatars.githubusercontent.com/u/7984905?v=3","gravatar_id":"","url":"https://api.github.com/users/peterph-am","html_url":"https://github.com/peterph-am","followers_url":"https://api.github.com/users/peterph-am/followers","following_url":"https://api.github.com/users/peterph-am/following{/other_user}","gists_url":"https://api.github.com/users/peterph-am/gists{/gist_id}","starred_url":"https://api.github.com/users/peterph-am/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterph-am/subscriptions","organizations_url":"https://api.github.com/users/peterph-am/orgs","repos_url":"https://api.github.com/users/peterph-am/repos","events_url":"https://api.github.com/users/peterph-am/events{/privacy}","received_events_url":"https://api.github.com/users/peterph-am/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-11T01:40:13Z","updated_at":"2015-02-27T11:13:33Z","closed_at":"2015-02-16T18:34:36Z","body":"I'm trying to destroy the fullpage plugin when viewport width is smaller that 600px,\r\n\r\nfirst of all i get a js error:\r\n\r\n**Uncaught TypeError: Cannot read property 'top' of undefined**\r\nline 121: $('html, body').scrollTop(element.position().top);\r\n\r\nI tried commenting it out and that stopped the error.\r\n\r\nHowever when I resize the browser under 600px, the destroy function seems to fire then undo, so the slide heights get removed then added again:\r\n\r\n\r\n\r\n````\r\nvar _slider = function() {\r\n    if (VPW > 600 && $('#main').hasClass('js_homepage')) {\r\n        $(document).scrollTop(0);\r\n        _el.container.fullpage({\r\n            //Options\r\n            navigation: false,\r\n            navigationPosition: 'left',\r\n            slidesNavigation: true,\r\n            autoScrolling: true,\r\n            continuousVertical: false,\r\n            css3: true,\r\n            easing: 'easeOutQuart',\r\n            easingcss3: 'ease',\r\n            loopBottom: false,\r\n            loopHorizontal: true,\r\n            loopTop: false,\r\n            normalScrollElementTouchThreshold: 5,\r\n            resize: false,\r\n            scrollBar: true,\r\n            scrollingSpeed: 1000,\r\n            scrollOverflow: false,\r\n            sectionSelector: _el.slides,\r\n            touchSensitivity: 15,\r\n            responsive: 600,\r\n            //events\r\n            onLeave: function(index, nextIndex, direction) {\r\n                if (index === 1 && nextIndex === 2) {\r\n                    _el.header.removeClass('is_alt');\r\n                } else if (index === 2 && nextIndex === 1) {\r\n                    _el.header.addClass('is_alt');\r\n                }\r\n            },\r\n            afterLoad: function(anchorLink, index) {\r\n                if (index !== 1) {\r\n                    _el.header.removeClass('is_alt');\r\n                }\r\n                $(this).addClass('js_animate');\r\n            },\r\n            afterRender: function() {\r\n                // console.log('afterRender');\r\n                $(this).addClass('js_animate');\r\n            }\r\n        });\r\n    }\r\n};\r\n\r\nvar _resize = function() {\r\n    if (VPW < 600 && $('#main').hasClass('js_homepage')) {\r\n        _el.container.fullpage.destroy('all');\r\n    }\r\n};\r\n````"},"comment":{"url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/comments/76379019","html_url":"https://github.com/alvarotrigo/fullPage.js/issues/1010#issuecomment-76379019","issue_url":"https://api.github.com/repos/alvarotrigo/fullPage.js/issues/1010","id":76379019,"user":{"login":"richgcook","id":901289,"avatar_url":"https://avatars.githubusercontent.com/u/901289?v=3","gravatar_id":"","url":"https://api.github.com/users/richgcook","html_url":"https://github.com/richgcook","followers_url":"https://api.github.com/users/richgcook/followers","following_url":"https://api.github.com/users/richgcook/following{/other_user}","gists_url":"https://api.github.com/users/richgcook/gists{/gist_id}","starred_url":"https://api.github.com/users/richgcook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richgcook/subscriptions","organizations_url":"https://api.github.com/users/richgcook/orgs","repos_url":"https://api.github.com/users/richgcook/repos","events_url":"https://api.github.com/users/richgcook/events{/privacy}","received_events_url":"https://api.github.com/users/richgcook/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T11:13:33Z","updated_at":"2015-02-27T11:13:33Z","body":"@peterph-am Did you ever solve this 'Uncaught TypeError: Cannot read property 'top' of undefined' error? How did you keep it only firing once? And can you scroll on resize? I can't."}}