Skip to content

Remove resize event - causes browser tab to crash.#51

Open
paalwilliams wants to merge 1 commit into
mazedigital:masterfrom
paalwilliams:master
Open

Remove resize event - causes browser tab to crash.#51
paalwilliams wants to merge 1 commit into
mazedigital:masterfrom
paalwilliams:master

Conversation

@paalwilliams

Copy link
Copy Markdown

Hi there!

I noticed that the initializing during the resize event was causing my browser tab to crash in Chromium, Firefox, and Safari.

To replicate:

  • Use webticker according to the documentation
  • Resize quickly to the minimum browser width
  • attempt to resize the browser to full width again.

Listening for the resize event, continuing it, and restarting it once completed like the following in my code seemed to stop this behaviour, with no noticeable errors in functionality.

$('#webTicker').webTicker({    height:'75px', 
        duplicate: true, 
        rssfrequency: 0, 
        startEmpty: false, 
        hoverpause: false, 
        speed: 20,
        height: '50px'
    })

$(window).resize(() => {
    $('#webTicker').webTicker('stop')
    clearTimeout(window.resizedFinished);
    window.resizedFinished = setTimeout(function(){
        $('#webTicker').webTicker('cont')
    }, 250);
});

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

Successfully merging this pull request may close these issues.

1 participant