Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • Mark Kennedy Friend
    #190435

    Hi,

    I want to add another row or section above the top of the current Header.

    So on the first row/section there would be a logo and some large text.
    On the second row/section would be the menu.

    Any help or links to info would be greatly appreciated.

    TomC Moderator
    #505246

    Perhaps may be of assistance to you.

    😎

    Mark Kennedy Friend
    #505321

    That tutorial was great! thanks TomC.

    Now that I have added a new module position in the header the header overlaps the next section which is the hero-unit.
    Any ideas on how I can change the postion of the hero-unit so that it sits flush underneath the header?

    TomC Moderator
    #505391

    Sot hat I can try to best assist you further, please provide the url of the site you’re working on,
    as well as set your site to “Development Mode” within your Template Manager–General settings

    Mark Kennedy Friend
    #505463

    Figured it out!
    Needed to change the padding just for that container.

    #ja_slideshow_lite .container {
    padding-top: 120px;
    padding-bottom: 0;
    width: 100%;
    }

    Mark Kennedy Friend
    #506153

    Hi TomC,

    I need some help with the custom header.
    I have set my site to development mode and the dev site can be found here

    I want the logo to be vertically aligned to the center in the normal desktop view.
    And when it is in mobile view (320X480) to be a little smaller and sit under the click to call button next to the menu button.

    The header is broken in 360X640 Landscape.

    The slider doesn’t sit under the menu properly in the mobile view.
    Same thing happens when you use the menu’s. If you go to “about us” the top part is covered by the header.
    How can I fix this?

    How can I turn off the popup “select a style” from the menu?

    Any help or links to info is always greatly appreciated. 🙂

    phong nam Friend
    #506326

    Hi magneticeye,

    In order to adjust the logon on mobile/ desktop view, you can put below codes into templates/ja_onepage/css/custom.css file:

    @media (min-width: 1200px){
    .logo {
    margin-left: 370px;
    }
    }
    @media (max-width: 979px) and (min-width: 768px) {
    .logo {
    margin-left: 70px;
    }
    }
    @media (max-width: 767px) {
    .logo-image a {
    height: 40px;
    width: 180px;
    background-size: 100% 100%;
    }

    #ja-header .logo-image {
    top: 50px;
    left: 180px;
    }
    }

    These will make your logo look better.

    <blockquote>How can I turn off the popup “select a style” from the menu?</blockquote>

    You can remove this tooltip texts by opening templatesja_onepagejsscript.js file, then remove lines:

    setTimeout(function(){
    var cookie = $.cookie('jaopqktip');
    if(!cookie){
    $('#ja-quick-tips').show().css('opacity', 0).fadeTo(700, 1).delay(3000).fadeTo(700, 0, function(){
    $(this).hide();
    });

    $.cookie('jaopqktip', 1);
    }
    }, 1000);

    Make sure you backup file before editing.

    Mark Kennedy Friend
    #506594

    Thanks Leo,

    That helped a great deal. I am still having trouble with the header layout between 600px wide and 767px wide.
    If you have any suggestions that would be great! 🙂

    phong nam Friend
    #506617

    Hi magneticeye,

    You can try to put these codes into custom.css file too:

    /*Adjust the logo and off-canvas button on iPad portrait view*/
    @media (min-width: 600px) and (max-width: 767px) {
    .t3-mainnav {
    margin-left: -150px;
    margin-top: -30px;
    }

    .t3-mainnav .navbar-inner {
    background: none;
    }

    .ja-header.navbar-fixed-top .container {
    margin-bottom: 3px;
    }

    #ja-header .logo-image {
    left: 40%;
    }

    #ja-header .logo-image {
    top: 45px;
    }

    .t3-mainnav {
    height: 15px;
    }
    }

    It will help the logo look better on iPad portrait view.

    Mark Kennedy Friend
    #506699

    Hi Leo,

    That worked really well, I made a slight adjustment to one of the values.
    In the end I really need to spend some time to understand how bootstrap works so I can avoid using
    position: absolute;
    to position all of the header elements.

    I have another question.
    Because I changed the size of the header in mobile size the menu doesn’t take you to the correct position. It is roughly out by 50px.
    How would I get it to the correct position?

    phong nam Friend
    #506712

    Hi magneticeye,

    You can try to put below codes into custom.css file:

    @media (max-width: 767px) {
    body.homepage .onepage {
    padding: 53px 0;
    }
    }

    Adjust the value until you get perfect.

    Mark Kennedy Friend
    #507093

    That worked! Thanks Leo!

    Mark Kennedy Friend
    #507757

    Hey Leo,

    So I have had some time to look at this problem again because I wasn’t ever really satisfied with the solution.

    After some messing around with some stuff I have figured out that ja-header correlates to this code

    <body class="homepage" data-target="#t3-mainnav" data-spy="scroll" data-offset="61">

    where data-offset equals the same height as ja-header. Now I checked this in the original version of JA-Onepage and it still holds true.

    To see what was happening better I changed this code temporarily with firebug.

    <header id="ja-header" class="wrap ja-header navbar-fixed-top navbar-collapse-fixed-top">
    to
    <header id="ja-header" class="wrap ja-header navbar-fixed-bottom navbar-collapse-fixed-bottom">

    Then when you click menu items you can see in desktop view that there is an offset that matches the data-offset value.
    Which would make sense because you want about us to show up under the floating menu.

    However, when you swap to a mobile view, say 360×640, there is no offset from the top. It just happens that there is enough padding in the original JA-Onepage that you get away with it.

    So it seems that the offset is turned off for mobile.

    Is there a way to turn this back on so the offset from the top is the same as ja-header for mobile size?

    My best guess is that it resides in header.php in the smooth scroll section.

    <!-- smooth scroll -->
    <script type="text/javascript">
    !function($) {

    var winurl = window.location.href.replace(/([^#]*)(.*)/, '$1');

    window.reflow = function () {
    if('ontouchstart' in window){
    document.documentElement.style.width = (document.documentElement.offsetWidth + 1) + 'px';
    setTimeout(function () {
    document.documentElement.style.width = '';
    }, 0);
    }
    };

    $('.navbar ul li a').each (function (){
    var href = this.href,
    target = this.hash ? this.hash : href.replace(/.*(?=#[^s]+$)/, ''),
    target_url = href.replace(/([^#]*)(.*)/, '$1');

    if(this.hostname != window.location.hostname || target.substr(0, 1) != '#'){
    return;
    }

    $(this).attr('href', target).data('target', target);
    });

    $('.navbar ul li a').click (function(e) {
    if (!$(this).data('target')){
    return;
    }

    var target = this.href.replace(/.*(?=#[^s]+$)/, '');
    if (target && ($(target).length)) {
    e.preventDefault();

    $('html,body').animate({scrollTop: Math.max(0,
    $(target).offset().top
    - ((!($('html').hasClass('off-canvas') && $('.btn-navbar').is(':visible')) && $('#ja-header').css('position') == 'fixed') ? $('#ja-header').height() : 0)
    + 2)}, {
    duration: 800,
    easing: 'easeInOutCubic',
    complete: window.reflow
    });
    } else { //not found
    var home = $('.navbar ul li a.home').attr('href');
    if(home){
    window.location.href = home.replace(/([^#]*)(.*)/, '$1') + target;
    }
    }
    });

    $(document).ready(function(){
    var ftarget = window.location.href.replace(/.*(?=#[^s]+$)/, '');

    if(ftarget.substr(0, 1) == '#'){
    ftarget = $(ftarget);

    if(ftarget.length){
    $('html,body').scrollTop(Math.max(0, ftarget.offset().top - ((!($('html').hasClass('off-canvas') && $('.btn-navbar').is(':visible')) && $('#ja-header').css('position') == 'fixed') ? $('#ja-header').height() : 0) + 1));
    window.reflow();
    }
    }

    var homelink = $('.navbar ul li a.home')[0];
    if(homelink){
    var home_url = homelink.href.replace(/([^#]*)(.*)/, '$1'),
    home_target = homelink.hash ? homelink.hash : homelink.href.replace(/.*(?=#[^s]+$)/, '');

    if(home_url == winurl){
    if(home_target.substr(0, 1) != '#'){
    homelink.href = home_target = '#onepage-home';
    $(homelink).data('target', home_target);
    }

    home_target = $(home_target);
    if(!home_target.length){
    home_target = $('<div id="onepage-home" style="width: 0; height: 0; visibility: hidden">').prependTo(document.body);
    }

    } else {
    home_target = null;
    }

    $(homelink).unbind('click').click(function(e){

    if(home_target){
    e.preventDefault();

    $('html,body').animate({scrollTop: Math.max(0, (home_target.offset().top - $('#ja-header').height() + 2))}, {
    duration: 800,
    easing: 'easeInOutCubic',
    complete: window.reflow
    });
    }
    });
    }
    });
    }(window.jQuery);
    </script>
    <!-- //smooth scroll -->

    I know this might be beyond the scope of support, but I do feel that it isn’t an unreasonable request to adjust the height of the header and have the sections lineup where they are supposed to for both mobile and desktop.

    As always, any help is appreciated. 🙂

    phong nam Friend
    #507782

    Hi magneticeye,

    When you open templatesja_onepagejsscript.js files, you can see that we did call the data-offset for the scroll on both desktop/mobile view at lines:

    $(document).ready(function(){
    var headHeight = $('#ja-header').outerHeight();
    if(headHeight){
    $(document.body).attr('data-offset', headHeight).data('offset', headHeight);
    }
    });

    You also can check it via our JA Onepage demo site at http://joomla-templates.joomlart.com/ja_onepage/ .In this case, you can use your customized scripts if you feel that they make the scroll smoothly.

    Mark Kennedy Friend
    #507832

    Hey Leo,

    Maybe some pictures will illustrate what I am after.

    So if I go to http://joomla-templates.joomlart.com/ja_onepage/ and change the screen size to mobile and click on a menu item the start of the section doesn’t line up with the bottom of the menu, it lines up with the top of the page. This obscures the title in this case because the language stuff is turned on.
    As seen here:

    Even with the language stuff turned off the start of the section is still obscured. This is after clicking the menu item.

    If we go to the desktop size and move the header to the bottom of the page temporarily by changing this code:

    <header id="ja-header" class="wrap ja-header navbar-fixed-top navbar-collapse-fixed-top">
    to
    <header id="ja-header" class="wrap ja-header navbar-fixed-bottom navbar-collapse-fixed-bottom">

    We can see that clicking on menu items brings on offset of 60px from the top of the window as seen here:

    To test that ja-header is affecting the offset from the top of the page I have to change padding in custom.css
    As you can see here the new height of ja-header affects where the page scrolls to when you click a menu item.

    When I swap to mobile size and click a menu item there is no gap/offset from the top of the page to where the section starts. As you can see in this next image, the header height is not affecting the offset.

    So as you can see from the images something is not working in the mobile size.
    Hopefully being the code ninja you are, you might be able to tell me what is up. 🙂


    1. Mobile_Size
    2. Local_Mobile_Size
    3. Local_desktop
    4. Desktop_new_ja-header
    5. New_ja-header_mobile
Viewing 15 posts - 1 through 15 (of 26 total)

This topic contains 26 replies, has 4 voices, and was last updated by  Ninja Lead 10 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum