Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #913000

    Hi guys,

    I would like to use my anchor link on a specific position off the page on mobile,
    but since the color section (with anchor) is hidden on mobile, the anchor doesn’t work.

    The Menu title that is linked to the anchor is called ‘Tarieven’
    I tried to add an extra color section with an ID right on top of the content. This works, but i can’t delete the white space the color section creates. Maybe this isn’t the best workaround after all.

    Is there an other way to add an anchor to a specific position?

    Can you guys help me out?

    link and pw in private content.

    #913028

    i created a customised hr.php : it shows the field for custom-id only when a whitespace is used.
    you can read all here – on top how to make it with download option

    https://webers-testseite.de/edited-enfold-alb-elements/#custom-id

    #913039

    Hi Guenni,

    thank you so much for your help! Anchor works perfect.. the only thing now is that this also causes a white space.
    I set my seperator on 0px, but this doesn’t help. any suggestions Guenni?

    • This reply was modified 6 years, 9 months ago by KingFilly.
    #913136

    Hi,

    Please try this in Quick CSS to remove the padding from that section:

    @media only screen and (max-width: 1200px) {
    .home #after_section_3 .content {
      padding:0 !important;
    }
    }

    Best regards,
    Rikard

    #913178

    Hi Rikard,

    unfortunately this doesn’t remove anything.
    The space is on every screen by the way. also larger than 1200px

    • This reply was modified 6 years, 9 months ago by KingFilly.
    #913343

    if it is not to often you can do this in functions.php of your child-theme

    function add_class_to_hr_id(){
    ?>
    <script>
    (function($){
    	 $('#custom-id').closest('.content').addClass('nopadding');
    	 $('.nopadding').css( 'padding' , '0px' );
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_class_to_hr_id');

    i want to do the code to proove first if hr has any id – and if so get the id and and – but i’m in a hurry now
    you must replace the custom-id with the id you have setted.

    i hope in css4 will be a parent selektor ! that would make such things definitly better

    #913468

    Hi,

    Please try this instead:

    .page-id-19 #after_section_3 .content {
      padding:0 !important;
    }

    Best regards,
    Rikard

    #913585

    so now – next day : this will determine if hr has any id , and if so the next parents (.content) padding is set to 0px.
    and set the class attributes as we want it.
    So you do not have to look on which place of the DOM ( if its after section 1, 2 etc.) you used the hr with id

    The function name is changed because this is more meaningfull – and we don’t need another class (nopadding) because we can set the css directly here.

    function add_class_to_parent_of_hr_with_id(){
    ?>
    <script>
    (function($){
    	 $('div.hr[id]').closest('.content').css( 'padding' , '0px' );
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_class_to_parent_of_hr_with_id');

    ! we could give to those hr’s with id’s the height 0 in this code – but sometimes you can use the hight to correct scroll down position.
    i use this hr like you like to use for anchors to scroll to, and because we can use this with sidebars too it is nice to have

    • This reply was modified 6 years, 9 months ago by Guenni007.
    #913621

    Hi,

    Thanks for sharing @guenni007 :-)

    Best regards,
    Rikard

    #918924

    hr.php : by the way the code has been changed a bit since 4.2.4
    and the folder-structure too. so now hr.php is in a subfolder called hr.

    See new download for hr.php since 4.2.4 here: https://webers-testseite.de/edited-enfold-alb-elements/#hr-with-id

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.