Tips for creating a div that toggles upwards

I need help with my mini menu that I created using bootstrap toggle. Currently, the mini menu toggles downwards, but I want it to toggle in an upward direction instead. Below is the code I have used. If there is a different method to achieve this, please let me know.

.mini-menu
{
  position: absolute;
  background-color: white;
  border: 1px solid lightgrey;
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 15px;
  margin-left: -200px;
  width: 200px;
}

.button-carrier
{
  position: fixed;
  top: 85%;
  left: 75%;
}
.button-round {
  border: none;
  cursor: pointer;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 22px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
  background: #2196F3;
}

.button-round {
  position: relative;
  overflow: hidden;
}

.button-round:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, .5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  20% {
    transform: scale(25, 25);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

.button-round:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="button-carrier">
    <div class="mini-menu collapse">
      <a href="#" >HOME</a>
      <br />
      <a href="#" >HOME</a>
      <a href="#" >HOME</a>
      <br />
     <a href="#" >HOME</a>
     <a href="#" >HOME</a>
      <br />
     <a href="#" >HOME</a>
    </div>
      <button class="button-round" data-toggle="collapse" data-target=".mini-menu"><i class="fa fa-bars"></i></button>
    </div>

Answer №1

Maybe you are interested in something along these lines.

.mini-menu {
  right: 100%;
  width: 200px;
  bottom: 0;
  position: absolute;
}

.mini-menu.collapsing {
  position: absolute;
}

.mini-menu .inner {
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 15px;
  background-color: white;
  border: 1px solid lightgrey;
}

.button-carrier {
  position: fixed;
  bottom: 15%;
  left: 75%;
}

.button-round {
  border: none;
  cursor: pointer;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 22px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
  background: #2196F3;
}

.button-round {
  position: relative;
  overflow: hidden;
}

.button-round:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, .5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  20% {
    transform: scale(25, 25);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

.button-round:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="button-carrier ">
  <div class="mini-menu collapse">
    <div class="inner">
      <a href="#">HOME</a>
      <br />
      <a href="#">HOME</a>
      <a href="#">HOME</a>
      <br />
      <a href="#">HOME</a>
      <a href="#">HOME</a>
      <br />
      <a href="#">HOME</a>
    </div>
  </div>
  <button class="button-round" data-toggle="collapse" data-target=".mini-menu"><i class="fa fa-bars"></i></button>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Click on a link to use jQuery to sort the order of the <li>

Looking to rearrange list items by clicking either move up or move down. <div> <ul> <li>Item A <a class="moveUp">Move Up</a> <a class="moveDown">Move Down</a></li> <li>Item B <a class="m ...

Guide to updating the background color of an element with AngularJs when clicked

I've used AngularJS's ng-repeat to display a list of <div> elements. When I select one <div> (div1), its background color changes to blue. If I then click on another <div> (div2), div1's background returns to white and div ...

Design the spans to have equal heights that adjust dynamically based on the content entered

I'm facing a challenge that I've been trying to resolve using just CSS, but I've hit a roadblock. The issue at hand involves aligning multiple spans next to each other and making them equal in height. The height is not fixed and depends on ...

Can validity api provide a means of displaying errors in a list format?

Currently, I'm working on developing a contact form and attempting to utilize the validity API for the first time. Adapting to WCAG2.1 standards has posed some challenges, but I've managed to display errors underneath each field as I code. Howeve ...

Repeatedly using jQuery to add elements twice

When I run this code, every time I click the '#right' button, the #slide increments by 2 instead of just 1. For example, if there are a total of 6 elements, it displays the 1st, 3rd, and 5th elements. var currentSlide=2; var totalSlides= ...

Angular state correctly maps to the controller but is not reflected in the HTML

I'm currently in the process of setting up a basic Angular application, something I've done many times before. I have defined a home state and another state for a note-taking app, but I am facing an issue where neither state is displaying or inje ...

Crafting a Cubic Masterpiece with Pure CSS Gradient Magic

Experimenting with various techniques involving linear gradients, I have achieved layers of multiple stripes but have encountered a block when it comes to the top face. My goal is to use gradients, whether linear or radial, to create a series of repeatin ...

The appearance of my sidebar items' right border varies depending on the web browser being used

My sidebar item's right border appears differently in Mozilla and Chrome. How can I resolve this issue? Here are the images from both browsers: https://i.stack.imgur.com/YGkkz.png https://i.stack.imgur.com/JxNs3.png "use client"; import { ...

Styling an element in CSS3 based on the status of an input checkbox

Can someone explain the purpose of using '~' in this code snippet? I came across this example in a tutorial and am curious about its significance. http://css-tricks.com/the-checkbox-hack/ I understand that it alters the styling of an element bas ...

Troubles with Semantic UI tab appearance

I followed the usage guidelines precisely as outlined on the Semantic UI page . I placed the tab.min.css file into my CSS folder and linked it correctly. However, when I view the page, it appears nothing like the Semantic UI tabs. Instead, it displays vert ...

Can CSS be used to automatically focus on a div element?

Can CSS be used to set autofocus on a div element? <div class="form-group" style="margin-left:10px"> <label for="organizationContainer" class="nmc-label">@Res.GroupStrings.CreateNewGroupOrganization</label> <div id="organiza ...

Learn the art of separating a CSS attribute and its value with Jquery

I'm currently facing a challenge with splitting a CSS value in jQuery. I have a styled div like this: .loadingTank { display: inline-block; border: 2px solid black; margin: 15px; max-width: 350px; height: 500px; width: 30%; ...

The replace() function is failing to replace the provided inputs

Supposedly, when a user types in certain profanity and submits it, the word is supposed to be replaced with a censored version. Unfortunately, this feature is not working as expected. The word appears uncensored. Do you think implementing if/else stateme ...

modify the color of a particular div element in real-time

I am looking to dynamically change the color of the divs based on values from my database. Here is what I have so far: Database: shape id is_success id1 0 id2 1 id3 0 id4 1 <div class="container" style="background: black; widt ...

Unique Description: "Bespoke Calculating Tool for Wordpress -

I recently created a calculator with 3 input fields to calculate heart rate for cardio sessions. However, I am facing challenges when trying to implement it into my WordPress site. When testing it out in a tryout editor on the web, it works fine (http://w ...

"Efficiently incorporating a responsive sprite background image on your website -

Hey there! I am dealing with a situation where I have two columns of content in a container. The first column contains text, and the second column is a span with a background sprite image. The issue arises when the screen resolution gets smaller - I want ...

What is the best way to guide users to various pages depending on session data in Python?

I'm just starting out with django and looking for advice on my current project. My goal is to develop a web application that helps manage traffic violations. Can someone point me in the right direction on where to begin? Below is an analysis example ...

Troubleshooting: Issue encountered while adding jQuery Slideshow plugin to current website

I am currently facing some challenges with a specific feature on my website. I am trying to integrate Jon Raasch's "Simple jQuery Slideshow Plugin" into an existing site that was not originally built by me. However, when viewing the site in IE 9, two ...

Having issues showcasing the array of objects stored in $scope in AngularJs

I'm encountering an issue where I can't seem to display the values of my scope variables. Even though I'm new to Angular, I've successfully done this many times before. Here are the key parts of my index.html file. The div-ui element is ...

The URL in $.mobile.changePage has not been updated

One of the challenges I encountered was switching between two pages - a menu list page and a menu detail page. The transition from the menu to the menu detail page was achieved using $.mobile.changePage. While everything seemed to be working correctly, the ...