fullscreen-parallax icon indicating copy to clipboard operation
fullscreen-parallax copied to clipboard

Long content not working!

Open vascoe opened this issue 10 years ago • 4 comments

If there is longer content there is an overflow problem: problem

Any ideas how to fix this?

vascoe avatar Dec 09 '14 15:12 vascoe

need to check the required height for the content based on the height of the of the section: e.g. if $('#two > div').innerHeight() is greater than $('#two').height() then change the section to the content height $('#two').height($('#two > div').innerHeight())

stefanclark avatar Dec 09 '14 16:12 stefanclark

That sounds good!Thank you! But unfortunately I'm not really the best JavaScript coder!?!? where should I do this?

vascoe avatar Dec 09 '14 16:12 vascoe

I've not tested this, but try changing line 140:

$this.css({height: $window.height() * heightmult});

to

contentHeight = 0;
$this.children().each(function(){contentHeight += $(this).height()});
if (contentHeight > $window.height() * heightmult) {
    $this.css({height: contentHeight});
} else {
    $this.css({height: $window.height() * heightmult});
}

stefanclark avatar Dec 09 '14 17:12 stefanclark

Hey thats nice Thank you!! it works but to adjust the position of the background Image I had to change line 79 from this:

var windowHeight = $window.height() * heightmult;

to this

contentHeight = 0;
$this.children().each(function(){contentHeight += $(this).height()});
if (contentHeight > $window.height() * heightmult) {
   var windowHeight = contentHeight ; 
} else {
   var windowHeight = $window.height() * heightmult;
}

Thanks a lot!

vascoe avatar Dec 09 '14 17:12 vascoe