if (typeof(window.innerWidth) == 'number') {
innerWidth = window.innerWidth;
}
must not be
if (typeof(window.innerWidth) == 'number') {
windowWidth = window.innerWidth;
}
?
And further in the code
var contentWidth = contentElement.offsetWidth;
but contentWidthnever used again ...
In addition, you should use elseif()to prevent many nested if-clausules.
source
share