Given this code:
if(ipadmenuheight < contentheight).css('top', '' + contentheight + 44 + 'px');
Let’s say contentheight=500
then this code snippet returns 50044px. How can it be a sum instead and return 544px?
Do I need to use a variable or can I do this inline?
Use a parenthesis to sum both numbers. If not, they will be appended as strings:
By the way, the first empty string
''is not needed, so you could also do: