Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'show' of undefined #195

Open
kdon80 opened this issue May 15, 2015 · 2 comments
Open

Uncaught TypeError: Cannot read property 'show' of undefined #195

kdon80 opened this issue May 15, 2015 · 2 comments

Comments

@kdon80
Copy link

kdon80 commented May 15, 2015

I have ajax pages, when trying to leave the current page that has the scroll in it, it keeps throwing this message.
Before leaving the page (rewriting using ajax), I even tried destroying the scroll. It successfully destroys but somehow the following event gets called:

_showHideHotSpots: function () {

the actual error happens here when calling show().

if (o.hotSpotScrolling && o.autoScrollingMode !== "always" && el.data("autoScrollingInterval") !== null) {
    el.data("scrollingHotSpotLeft").show();
    el.data("scrollingHotSpotRight").show();

I don't understand how this if statement passes since the scroll is already destroyed...

thanks,

@kdon80
Copy link
Author

kdon80 commented May 15, 2015

The issue is in the window resize binding! After destroying it, window resize is still bound!

 (window).bind("resize", function () {
            self._showHideHotSpots();

@kdon80
Copy link
Author

kdon80 commented May 15, 2015

You should this in the instruction:
That when destroying the element, you might want to unbind the resize:
$(window).off("resize");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant