Tagged: x
-
AuthorPosts
-
December 21, 2016 at 6:21 pm #1301060
pdelucaParticipantHi, Im trying to achieve this kind of behavior with the footer:
1) The footer should be visible if the content above it is shorter than the user’s viewport height.
2) If the content is taller than the user’s viewport height, then the footer should disappear from view and rest at the bottom of the page, as it would naturally.Any ideas how to make this happen? URL is http://81c.e86.myftpupload.com/homepage/
Thanks,
Pablo.December 21, 2016 at 6:25 pm #1301065
pdelucaParticipantThis is a sample where the content sometimes doesnt fill the screen so the footer should be at the bottom of it.
http://81c.e86.myftpupload.com/loch-arbor-project/
Pablo.
December 21, 2016 at 10:09 pm #1301357
LelyModeratorHello Pablo,
Please try add the following code on Appearance > Customize > Custom > Edit Global Javascript:
jQuery(document).ready(function ($) { if ($("body").height() < $(window).height()) { $('.x-colophon.bottom').css({'position':'fixed', 'width':'100%'}); } });Hope this helps.
December 22, 2016 at 12:32 pm #1301932
pdelucaParticipantThanks Lely. I tried that piece of code but unfortunately it didnt work.
Pablo.
December 22, 2016 at 4:35 pm #1302102
NicoModeratorHi There,
In this case, would you mind sharing us your admin credentials in private reply.
Don’t forget to set it as private reply.
Thanks.
December 23, 2016 at 1:22 pm #1302995
pdelucaParticipantThis reply has been marked as private.December 23, 2016 at 9:05 pm #1303310
RadModeratorHi there,
I tried it and credentials are not correct. Please provide the latest one.
Thanks!
December 26, 2016 at 11:03 pm #1305227
pdelucaParticipantThis reply has been marked as private.December 27, 2016 at 12:58 am #1305357
Paul RModeratorHi Pablo,
You can try this code instead.
jQuery( document ).ready(function($) { $(window).on("resize", function () { var adminbarHeight = $('#wpadminbar').height(); var windowHeight = $( window ).height(); var mastheadHeight = $('.masthead').outerHeight(); var landmarkHeight = $('.x-header-landmark').outerHeight(); var footerHeight = $('.x-colophon.top').outerHeight(); var subHeight = mastheadHeight + footerHeight + landmarkHeight + adminbarHeight; var contentHeight = windowHeight - subHeight; $('.x-main').css('min-height',contentHeight); }).resize(); });Hope that helps
December 27, 2016 at 1:25 pm #1306153
pdelucaParticipantHi Paul, it seems that piece of code worked very well.
Thanks,
Pablo.December 27, 2016 at 1:30 pm #1306160
JoaoModeratorGlad to hear it 🙂
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1301060 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
