My suggestion was not to replace the line:
winWidth = window.innerWidth ? window.innerWidth : $(window).width();
... but to make the adjustment after it, e.g.:
winWidth = window.innerWidth ? window.innerWidth : $(window).width();
winWidth = winWidth - 20;
The code which determines the window width will return the result in pixels so you should stick to using a pixel value for this right-hand border so you can subtract the border (px) from the window width (also px).
Also, when making the adjustment to the winWidth value, the code will be purely arithmetic so you should not use a suffix, such as px. (I used a suffix in my original code above but I have corrected the error. Sorry for any inconvenience.)
Use a CSS border such as:
body {
margin-right: 20px;
}
... and then use either:
winWidth = window.innerWidth ? window.innerWidth : $(window).width();
winWidth = winWidth - 20;
... or:
winWidth = window.innerWidth ? window.innerWidth - 20 : $(window).width() - 20;
I have tested this myself and it seems to work fine.