I’m trying to create a rotating banner (JavaScript & CSS). For debugging and making changes on the CSS etc in the developers’ console, I want to pause the JavaScript execution while I make changes and then run it or so on.
So, is there a way to pause the script execution in the browser?
I’m trying to create a rotating banner (JavaScript & CSS). For debugging and making
Share
You are looking for “breakpoints”.
Which browser are you using?
Chrome supports breakpoints right away in its developer tools:
F12 (or Ctrl-Shift-I), “Script” tab, select script from dropdown, click the line number.Update:
On PC: F12 or Ctrl+Shift+I / On Mac: Cmd+Alt+I
select “Sources” tab, select script from the file pane on the left, click the line number.
In Firefox use the Firebug extension:
On PC and Mac: F12,
“Script” tab, activate & reload if needed, select script from dropdown, click line number.
When your Javascript pauses at a breakpoint, both browsers offer you the usual debugging tools to single step through the code, inspect & change variable values, watch expressions,…