• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Mobile Menu Not Working Fully

New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I have used a Bootstrap nav bar with a drop down menu at the right and have included a sub menu this all works fine until I get to the breakpoint for a mobile phone. The hamburger works fine, the drop down menu works fine and changes to a slider to access all menu items but when I click on the arrow to the right for the submenu it closes the section down. Presumably as there is no where to the right to push the sub menu out to. Please can you tell me how to fix this issue.

http://addesignandprint.co.uk/Test/celebrations.html

I have only started the addition of the sub menu on this one page and not adding to others until I have it working on one page!

I would appreciate help in this matter

Liz

Views

3.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Seems to be working as it should do when I look at it. A sub-menu of 'Celebration Stationery' opens up BENEATH the category title.

Personally I think the Bootstrap responsive nav is a poor solution because it truncates the menu at a specific height and you can miss whats 'concealed' unless you watch the vertical scroll bar carefully.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

If you go down the list as you say it opens a list under Celebration Stationery and then at the bottom it says Make Your Choices which then opens out to the right and should give 5 more options starting with Card bases and finishing at the moment on font choices.

How would you suggest?

Liz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Measha06  wrote

If you go down the list as you say it opens a list under Celebration Stationery and then at the bottom it says Make Your Choices which then opens out to the right and should give 5 more options starting with Card bases and finishing at the moment on font choices.

How would you suggest?

Liz

I dont see an option for 'Make Your Choices'?

I just see these options listed:

Celebrations

Wedding Stationary Items

Something else here

Separate Link

FAQ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I have re-uploaded the files can you please double check for me. Originally I was like you on Chrome but could see all on edge and IE now I can see on all

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I think that you should clear these errors first [Invalid] Markup Validation of http://addesignandprint.co.uk/Test/celebrations.html - W3C Markup Val...

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Thanks these have been created by using Dreamweaver, I am a designer not a coder and would have run the check and validation when I have all the coding in place. As you can tell by URL it is not live yet it is only in text and build mode. But I will attend to this page now

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

In order to rectify these issues I have had to alter coding from where Dreamweaver has put it and I understood Dreamweaver was to take the coding element out of building web pages as I am not a coder. I believe that page has now passed WC3 validation but it also means I have to correct every other page I've built for this website. Straying from my original question which is not sorted why is Dreamweaver positioning code where WC3 validation dislikes?

Perhaps now with this page passing validation somebody can help with my original question remembering I am not a coder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

PS one of the errors causing it not to pass validation was from copying and pasting google fonts into the code as per the instructions and it saying it was an invalid character. Why does google ask you to put unacceptable characters in?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

The code looks much better now that it is error free.

Now to answer your original question and assuming that you are not working with Less or Sass, add the following to your style rules (CSS).

@media (max-width: 767px) {
  
.navbar-collapse {
       max
-height: auto;
       overflow
-x: auto;
  
}
}
Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Many thanks, I will try. It has made no difference still does exact the same thing. Once you click on Make your choices it goes to the top menu bar items before any drop downs.

Above is once you've clicked on Celebration Stationery showing Make your choice at the bottom.

This after clicking on Make Your Choices and it goes back to top level menu bar items.

Can you tell me why Dreamweaver 'wrote' incorrect code and google tell you to put code in that's unacceptable to verification?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I have made some changes to the navbar. Please replace all from <nav class="navbar navbar-default navbar-fixed-top"> to and including </nav> with the following

<nav class="navbar navbar-default navbar-fixed-top">

  <div class="container">

  <!-- Brand and toggle get grouped for better mobile display -->

  <div class="navbar-header">

  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>

  </div>

  <!-- Collect the nav links, forms, and other content for toggling -->

  <div class="collapse navbar-collapse" id="topFixedNavbar1">

  <ul class="nav navbar-nav navbar-right">

  <li><a href="index.html">Home</a></li>

  <li><a href="contact-us.html">Contact Us</a></li>

  <li><a href="business-stationery.html">Corporate</a></li>

  <li><a href="embroidery.html">Embroidery</a></li>

  <li><a href="everything-web.html">Everything Web</a></li>

  <li><a href="self-publishing.html">Self-Publishing</a></li>

  <li class="dropdown">

  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Celebration Stationery <span class="caret"></span></a>

  <ul class="dropdown-menu">

  <li><a href="celebrations.html">Celebrations</a></li>

  <li><a href="wed-stationery-items.html">Wedding Stationery Items</a></li>

  <li role="separator" class="divider"></li>

  <li><a href="faq.html">FAQ</a></li>

  <li role="separator" class="divider"></li>

  <li class="dropdown-submenu pull-left"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Make Your Choices</a>

  <ul class="dropdown-menu">

  <li><a href="cardbases.html">Base Choices</a></li>

  <li><a href="#">Card Choices</a></li>

  <li><a href="#">Accessorie Choices</a></li>

  <li><a href="#">Wedding Wording</a></li>

  <li><a href="#">Font Choices</a></li>

  </ul>

  </li>

  </ul>

  </li>

  </ul>

  </div>

  <!-- /.navbar-collapse -->

  </div>

  <!-- /.container-fluid -->

</nav>

I have removed superfluous code and added a pull-left to make the dropdown go to the left.

Change the style rules that I gave you above to

@media (max-width: 767px) {

   .navbar-collapse {

       max-height: 620px !important;

       overflow-x: auto;

   }

}

Now you will notice that the scrollbar has disappeared for mobile users, but the effect that is worrying you still remains. The reason for this is because you are staying on the same page. Once you have linked the menu item to another page, the menubar will revert to the closed position on the new page.

I hope that helps.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I have tried that in place and its brilliant my only concern is that not having linked anything to 'make your choices' people in mobile view might not rollover it on to the next to discover the rest but in the other sizes it is just what I was trying all last night to do on my own and not getting there as not a coder. I haven't linked anything to Celebration Stationery but it works differently.

Do you have any suggestions for improvement in this area?

I assume that I need to replace the code in each and every page.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Measha06  wrote

I have tried that in place and its brilliant my only concern is that not having linked anything to 'make your choices' people in mobile view might not rollover it on to the next to discover the rest but in the other sizes it is just what I was trying all last night to do on my own and not getting there as not a coder. I haven't linked anything to Celebration Stationery but it works differently.

Do you have any suggestions for improvement in this area?

I assume that I need to replace the code in each and every page.

Not Bootstrap but its what you are aiming to achieve in mobile: Also if you are going to use a flyout menu on desktop I would move the link to the left a couple of places otherwise the flyout menu will be cut off in some users browsers

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>Flex Nav</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

<style>

body {

margin: 0;

}

.main-navigation-wrapper {

font-family: helvetica, sans-serif;

font-size: 14px;

line-height: 28px;

background-color: #AE69E0;

}

.main-navigation {

display: -webkit-box;

display: -ms-flexbox;

display: flex;

-webkit-box-pack: end;

-ms-flex-pack: end;

justify-content: flex-end;

width: 80%;

margin: 0 auto;

padding: 0;

}

.main-navigation li {

margin: 0;

padding: 0;

list-style: none;

position: relative;

}

.main-navigation li i {

font-size: 18px;

margin: 0;

padding: 0 0 0 5px;

float: right;

}

.main-navigation a {

text-decoration: none;

color: #fff;

display: block;

padding: 15px;

}

.main-navigation a:hover {

color: indigo;

}

/* drop menu */

.drop-menu {

position: absolute;

top: 4.1em;

left: 0;

background-color: #fff;

margin: 0;

padding: 0;

width: 200px;

border: 1px solid #d9d9d9;

box-shadow: 7px 7px 5px #d9d9d9;

}

.drop-menu {

display: none;

}

.drop-menu li {

width: 100%;

}

.drop-menu a {

padding: 10px 15px;

color: #000;

}

.drop-menu a:hover {

background-color: #f2f2f2;

}

/* end drop menu */

/* side menu */

.side-menu {

position: absolute;

top: 0;

left: 100%;

background-color: #fff;

margin: 0;

padding: 0;

width: 200px;

border: 1px solid #d9d9d9;

box-shadow: 7px 7px 5px #d9d9d9;

}

.side-menu {

display: none;

}

/* end side menu */

.mobile-menu-icon {

display: none;

}

@media screen and (max-width: 960px) {

.main-navigation {

display: none;

}

.mobile-menu-icon {

display: block;

text-align: right;

color: #fff;

padding: 15px 40px;

font-size: 20px;

}

.main-navigation li {

width: 100%;

}

/* drop menu */

.main-navigation .drop-menu {

position: static;

width: 100%;

box-shadow: none;

}

/* side menu */

.main-navigation .side-menu {

position: static;

width: 100%;

box-shadow: none;

border: none;

}

}

</style>

<script>

$(document).ready(function(){

//show drop menu

$('.drop-menu-show').css('cursor', 'pointer').click(function() {

$(this).find('.drop-menu').show().end().siblings().find('ul').hide();

});

//show side menu

$('.side-menu-show').css('cursor', 'pointer').click(function() {

$(this).find('ul').show();

});

// show mobile menu icon at 960px window width

$('.mobile-menu-icon').css('cursor','pointer').click(function(){

$('.main-navigation').slideToggle();

});

//realign main-navifation and hide drop menu at 960px window width

$(window).resize(function(){

if ($(window).width() > 960) {

$('.main-navigation').css({'display': '-webkit-box' , 'display': '-ms-flexbox' , 'display': 'flex'});

$('.drop-menu').hide();

}

else if ($(window).width() < 960) {

$('.main-navigation').css('display', 'none');

}

});

});

</script>

</head>

<body>

<nav class="main-navigation-wrapper">

<div class="mobile-menu-icon"><i class="fa fa-bars"></i></div>

<ul class="main-navigation">

<li><a href="#">Home</a></li>

<li><a href="#">Contact Us</a></li>

<li><a href="#">Corporate</a></li>

<li><a href="#">Embroidery</a></li>

<li><a href="#">Everything Web</a></li>

<li class="drop-menu-show"><a href="#">Celebration Stationery<i class="fa fa-caret-down" aria-hidden="true"></i>

</a>

<ul class="drop-menu">

<li><a href="#">Celebrations</a></li>

<li><a href="#">Wedding Stationery Items</a></li>

<li><a href="#">FAQ</a></li>

<li class="side-menu-show"><a href="#">Make Your Choices <i class="fa fa-caret-right" aria-hidden="true"></i>

</a>

<ul class="side-menu">

<li><a href="#">Base Choices</a></li>

<li><a href="#">Card Choices</a></li>

<li><a href="#">Accessory Choices</a></li>

<li><a href="#">Wedding Words</a></li>

<li><a href="#">Font Choices</a></li>

</ul>

<!-- end side-menu -->

</li>

</ul>

<!-- end drop=menu -->

</li>

<li><a href="#">Contact Us</a></li>

</ul> <!--end main-navigation-->

</nav>

<!-- end main-navigation-wrapper -->

</body>

</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

I was just wondering if we can alter the right facing arrow to a downwards facing or left arrow as pointing to the right and nothing going right seems weird.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

I don't know which arrow you mean, but you can use Glyphicon classes to change caret direction.

http://getbootstrap.com/components/

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

It is the arrow in the drop down sub menu that Ben Pleiser rewrote the code for above.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

If you mean this, the caret is correctly pointing down to indicate there is a submenu.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

No I mean the bottom one as in image below, as when you click on Make Your Choices it goes out to the left and down not out to the right, as in image to the right below.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

OK.  So what you really want is something like this:

You can get the HTML & CSS code from here:

Bootstrap Snippet Multi level dropdown menu BS3 using HTML CSS | Bootsnipp.com

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

The OP already has a working dropdown menu. If you have a look at the image in reply #33, the caret next to 'Make Your Choices' points to the right. What she wants is have point to the left because the sub-menu flies out to the left.

In my personal opinion, I would leave the caret as it is because it is a well known way to show that there is a sub-menu regardless of where that submenu is.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

As l said in a post if you want the submenu to fly out to the right then move that link 2 or 3 to the left. That will give you enough real estate on desktop to have if fly out to the right. On mobile it should open straight down.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2017 Jun 18, 2017

Copy link to clipboard

Copied

Thanks for the replies guys but I don't think apart from Ben my queries has been absorbed correctly. Ben re wrote the code for me so the flyout is to the Left as the images show but the arrow indicating a flyout depicts to the right and I wondered how and where to change this to a left arrow or a down arrow (caret).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

Measha06  wrote

Thanks for the replies guys but I don't think apart from Ben my queries has been absorbed correctly. Ben re wrote the code for me so the flyout is to the Left as the images show but the arrow indicating a flyout depicts to the right and I wondered how and where to change this to a left arrow or a down arrow (caret).

I think we have absorbed what you are trying to do but probably don't think youre approaching it correctly.

This is the bit of code the creates a down arrow:

<i class="fa fa-caret-down" aria-hidden="true"></i>

This is the bit of code that creates a right arrow:

<i class="fa fa-caret-right" aria-hidden="true"></i>

This is your current code: Swap the fa fa-caret-right for fa fa-caret-down

<li class="side-menu-show"><a href="#">Make Your Choices <i class="fa fa-caret-right" aria-hidden="true"></i>

I'm not sure it actually looks right at the moment anyway where it opens to the left and covers the link. It looks a bit forced and akward to me. If you don't want to move the top level link from its current position to create more room for the sub-menu to open on the right then I would just have the sub-menu open downward on desktop and mobile.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

I don't actually mind it covering that particular link as it is only a link to the sub menu and not on to anywhere else, so clicking it once you get to that part is the important part and it being covered afterwards is not a disadvantage. Perhaps it should be a Heading Link or something but Ben was kind enough to write the code for me and this is how it came.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines