Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change bootstrap drop down to drop horizontal right

I have a drop down menu that opens a row of icons underneath it (see picture 1, names and pictures were removed to maintain privacy) enter image description here

I am trying to make this menu to open to the right of choose child, and not underneath it (see picture 2, of what I am trying to get. the Images will open to the right of the drop down and not under it) enter image description here

My current code is:

<div class="span4">      
        <div class="btn-group">
  <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
  <h3>Choose Child</h3>
  <img id="mainIcons" src="boyStudent.png" alt="boyStudent">
  <span class="caret"></span></a>
  <ul class="dropdown-menu">
    <li>
        <div class="btn-group">
      <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
       <h5>A</h5>
       <img id="mainIcons" src="boyStudent.png" alt="boyStudent"></a>
       <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
       <h5>J</h5>
       <img id="mainIcons" src="girlStudent.png" alt="girlStudent"></a>
     </div>
    </li> 
  </ul>

I tried to use the following example, that helps push the drop down to the left how to make twitter bootstrap submenu to open on the left side? but I could not figure out a way to use this to what I am looking to do

Thanks

like image 726
Quantico Avatar asked May 07 '13 00:05

Quantico


1 Answers

How does this look:-

Demo

Demo2 Submenu dropping down.

<div class="span4">
    <div class="btn-group"> <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
              <h3>Choose Child</h3>
              <img id="mainIcons" src="boyStudent.png" alt="boyStudent">
               <span class="right-caret right"></span>
         </a>

        <ul class="dropdown-menu rightMenu">
            <li>
                <div class="btn-group"> <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
                   <h5>A</h5>
                   <img id="mainIcons" src="boyStudent.png" alt="boyStudent"></a>
 <a href="parent_homepage_2.html" style="text-align:center;" class="btn btn-link operationsButtons">
                   <h5>J</h5>
                   <img id="mainIcons" src="girlStudent.png" alt="girlStudent"></a>

                </div>
            </li>
        </ul>
    </div>

css

   .rightMenu {
    position:relative;
    float:right;
}
.right-caret {
    
    border-bottom: 4px solid transparent;
    border-top: 4px solid transparent;
    border-left: 4px solid #000000;
    display: inline-block;
    height: 0;
    opacity: 1;
    vertical-align: top;
    width: 0;
    
}
.right
{
    float:right;
}
like image 155
PSL Avatar answered Sep 17 '22 20:09

PSL