sum not working

sum not working

Hi there.. Could someone tell me why this code give me as result of totViewNav 1935 instead of 54 (the sum)? I premise that I'm putting this on a wordpress theme.. thx in advance!

  1. jQuery( window ).load(function(){
  2. var halfWindowHeight = jQuery( window ).height()/2;
  3. var halfViewportHeight = jQuery('.flex-active-slide').height()/2;
  4. var viewportNavHeight =  jQuery('.flex-control-nav').height();
  5. var paddingViewNav = jQuery('.flex-control-nav').css('padding-top').replace('px', '');
  6. var totViewNav = viewportNavHeight + paddingViewNav;
  7. var result = halfWindowHeight - halfViewportHeight - totViewNav;
  8. jQuery('.flex-viewport').css("margin-top", result + "px");

  9. });