BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Ipad
- This topic has 10 replies, 2 contibutors, and was last updated 9 years, 8 months ago by Alyssa.
Question
March 20, 2015 at 4:33 am #37600@rings06Hello,
is it possible to have the menu automatically closed when I’m on the iPad.
thanks.
Answers
March 21, 2015 at 5:36 pm #37663@alyssa-buddyboss
AlyssaParticipant@rings06 welcome to the buddyboss community! Add this to your child theme’s functions.php file:
function tablet_closed_menu(){ ?> <script> if ($( "body" ).hasClass("tablet") && !$( "body" ).hasClass( "page-template-page-no-buddypanel" ) ) { $( "body" ).removeClass( "left-menu-open"); } </script> <? } add_action('wp_footer','tablet_closed_menu',99999);
March 22, 2015 at 8:56 am #37694@rings06Hello,
I just tried the menu is always open on ipad.
Thanks
March 22, 2015 at 9:43 am #37705March 22, 2015 at 9:46 am #37707@rings06March 22, 2015 at 9:50 am #37708@alyssa-buddyboss
AlyssaParticipantHere is a slight edit to the code to check iPad in the useragent:
function tablet_closed_menu(){ ?> <script> if ((( /iPad|tablet/i.test(navigator.userAgent) ) || $( "body" ).hasClass("tablet")) && !$( "body" ).hasClass( "page-template-page-no-buddypanel" ) ) { $( "body" ).removeClass( "left-menu-open"); } </script> <? } add_action('wp_footer','tablet_closed_menu',99999);
March 22, 2015 at 9:56 am #37709@alyssa-buddyboss
AlyssaParticipantYou may want to try disabling plugins like scroll to top to see if there is a plugin conflicting with the script it works dandy on my dev server and plugin like scroll to top are known to cause conflicts. Try disabling other plugins as well.
March 22, 2015 at 1:25 pm #37737@rings06It works great but I have a message that is displayed with the min ipad configuration.
Can we not put this message.
Thank you.
Best Regards.
March 22, 2015 at 2:14 pm #37739@alyssa-buddyboss
AlyssaParticipant@rings06 so sorry, that was my debugging code 🙂 Code fixed inline above
March 23, 2015 at 1:29 am #37749@rings06It’s perfect !!
Thanks.
March 23, 2015 at 7:09 pm #37809@alyssa-buddyboss
AlyssaParticipantNo problem, I’ll close this issue out.
- The question ‘Ipad’ is closed to new replies.