-
AuthorPosts
-
February 15, 2018 at 10:48 pm #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.
February 16, 2018 at 12:11 am #913028i 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 optionhttps://webers-testseite.de/edited-enfold-alb-elements/#custom-id
February 16, 2018 at 1:41 am #913039Hi 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.
February 16, 2018 at 6:30 am #913136Hi,
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,
RikardFebruary 16, 2018 at 9:17 am #913178Hi 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.
February 16, 2018 at 6:57 pm #913343if 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
February 17, 2018 at 5:23 am #913468Hi,
Please try this instead:
.page-id-19 #after_section_3 .content { padding:0 !important; }
Best regards,
RikardFebruary 17, 2018 at 9:22 am #913585so 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 idThe 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.
February 17, 2018 at 1:08 pm #913621February 28, 2018 at 10:49 am #918924hr.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
-
AuthorPosts
- You must be logged in to reply to this topic.