I using a mobile menu for my website which is dropping down from the top to the bottom. Is their a way to get it open from the left, like the sidebar does? I'm not that familiar with css animation and I tried transform: rotate(90deg); but without any effects.
The mobile menu is visible here https://www.amaoni.de
it can be easily done by using ul,li tags
ul,li{
list-style:none;
padding:0px;
margin:0px;
}
#yourMenu{
border:1px solid #000;
height:200px;
width:30%;
}
#yourMenu>li{
width:100%;
padding:5px;
background-color:blue;
box-sizing:border-box;
color:#fff;
}
#yourMenu>li:hover{
cursor:pointer;
background-color:red;
}
<ul id="yourMenu">
<li>menu 1</li>
<li>menu 2</li>
<li>menu 3</li>
</ul>
Related
The website should have a maximum width of 1300px and three columns: left, content and right.
All columns should be individually scrollable.
The left and right columns should disappear to the outside after the button is pressed.
Most of it already works, but I can't find a solution for the following:
the right column is outside the page (max-width is ignored?)
All three columns behave differently when they are fade out;
right is good, left is too fast and content jumps and does not fade
/* dont display the checkboxes */
#nav_toggle_right,#nav_toggle_left{
position:absolute; opacity:0; display:none
}
/* more useless space */
ul li{
line-height: 8;
}
/* left button */
#nav_toggle_left~label.nav_toggle_left {
position:fixed;
display:block;
cursor:pointer;
text-align:center;
z-index:300;
font-size:28px;
width:40px;
height:40px;
top:9px;
left:20px;
line-height:40px;
}
#nav_toggle_left~label .lable_before {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px solid #000000;
border-radius:10px;
}
#nav_toggle_left~label .lable_after {
display:none;
}
#nav_toggle_left:checked~label .lable_before{
display:none;
}
#nav_toggle_left:checked~label .lable_after {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px solid #000000;
border-radius:10px;
}
#nav_toggle_left:checked~.menu_left {
-webkit-transform:translateX(-100vw);
transform:translateX(-100vw)
}
/* right button */
#nav_toggle_right~label.nav_toggle_right {
position:fixed;
display:block;
cursor:pointer;
text-align:center;
z-index:300;
font-size:28px;
width:40px;
height:40px;
top:9px;
right:20px;
line-height:40px;
}
#nav_toggle_right~label .lable_before {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px #000000);
border-radius:10px;
}
#nav_toggle_right~label .lable_after {
display:none;
}
#nav_toggle_right:checked~label .lable_before{
display:none;
}
#nav_toggle_right:checked~label .lable_after {
display:block;
color:#000000;
background-color:#FFFFFF;
border:1px #000000);
border-radius:10px;
}
#nav_toggle_right:checked~.menu_right {
-webkit-transform:translateX(290px);
transform:translateX(290px)
}
/* widht of page */
.page{
max-width:1050px;
}
/* left menu */
.menu_left{
height:100%;
width:250px;
background-color:#f5f5f5;
border-right:solid 1px #c9c9c9;
inline-height:20px;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
left:0px;
top:0px;
position:fixed;
}
/* right menu */
.menu_right{
height:100%;
width:250px;
background-color:#e3e3e3;
border-left:solid 1px #c9c9c9;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
right:0px;
top:0px;
position:fixed;
}
/* content */
.content{
height:1000vh;
min-width:300px;
background-color:#FCFCFC;
scrollbar-width:none;
overflow-y:scroll;
overflow-x:hidden;
scrollbar-width:none;
margin-left:250px;
margin-right:250px;
padding:20px 20px 20px 20px;
}
/* content without menu(s) */
#nav_toggle_left:checked~.content{
margin-left:0px!important;
}
#nav_toggle_right:checked~.content{
margin-right:0px!important;
}
/* same transition for both menues */
.transition{
-webkit-transition:1.53s transform;
transition:1.53s transform;
-webkit-transition-timing-function:cubic-bezier(.38,.52,.37,1);
transition-timing-function:cubic-bezier(.38,.52,.37,1);
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" rel="stylesheet">
<div class="page">
<input type="checkbox" id="nav_toggle_left">
<label class="nav_toggle_left" for="nav_toggle_left">
<span class="lable_after">
<i class="fa fa-bars"></i>
</span>
<span class="lable_before">
<i class="fa fa-times"></i>
</span>
</label>
<div class="menu_left transition">
<ul>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
<li>Menu left</li>
</ul>
</div>
<input type="checkbox" id="nav_toggle_right">
<label class="nav_toggle_right" for="nav_toggle_right">
<span class="lable_after">
<i class="fa fa-list"></i>
</span>
<span class="lable_before">
<i class="fa fa-times"></i>
</span>
</label>
<div class="menu_right transition">
<ul>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
<li>Menu right</li>
</ul>
</div>
<div class="content">
<i class="fa fa-list"></i>
<i class="fa fa-times"></i>
<i class="fa fa-bars"></i>
If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?. If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?. Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy. Twitter is the rice of social media. Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy. A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road. Why don't we call glasses duocles. North America should be called Russia since people are always moving so fast. Gralitica. We need more werkin and less twerkin if you ask me. Balooby. I started a sensory deprivation chamber business - it involves really dark curtains, ear plugs, and a sleeping mask. To Catch A Predator would have been a great name for a Steve Irwin show. Mintslavicia. North America should be called Russia since people are always moving so fast. Gralitica. Most streets are two-way streets...why does that make love so special?. Thank you for using my words in your work. Twitter is the rice of social media.
</div>
</div>
Or a codepen
Maybe you could use flex-grow/flex-shrink.
https://css-tricks.com/almanac/properties/f/flex-shrink/
You can get a consistent transition using it.
Some examples given on this Question/Answers
Transition flex-grow of items in a flexbox
I don't know what this is called, so here's an image of what I want to do in an HTML form:
I want to select from a dropdown. As I scroll down the list, I want to show subordinate selections, like you do in this example from Windows. And use that final selection as the input to the form.
Can this be done?
It can be done but most likely you'll have to use a third party library.
This menu is called context menu.
Checkout the library below
http://swisnl.github.io/jQuery-contextMenu/index.html
If you just want to put input in a form then probably it's better to use a simple dropdown.
I guess you want to implement something like this. You will get many codes in google if you simply search for a multilevel drop down navigation menu.
ul
{
list-style:none;
position:relative;
float:left;
margin:0;
padding:0
}
ul a
{
display:block;
color:#333;
text-decoration:none;
font-weight:700;
font-size:12px;
line-height:32px;
padding:0 15px;
}
ul li
{
position:relative;
float:left;
margin:0;
padding:0
}
ul li.active
{
background:#ddd
}
ul li:hover
{
background:#f6f6f6
}
ul ul
{
display:none;
position:absolute;
top:100%;
left:0;
background:#fff;
padding:0
}
ul ul li
{
float:none;
width:200px
}
ul ul a
{
line-height:120%;
padding:10px 15px
}
ul ul ul
{
top:0;
left:100%
}
ul li:hover > ul
{
display:block
}
<nav>
<ul>
<li class="active">Home</li>
<li>Menu 1 ►
<ul>
<li>Sub Menu 1</li>
<li>Sub Menu 2 ►
<ul>
<li>Sub Sub Menu 1</li>
<li>Sub Sub Menu 2</li>
</ul>
</li>
<li>Sub Menu 3</li>
</ul>
</li>
<li>Menu 2 ►
<ul>
<li>Sub Menu 1</li>
<li>Sub Menu 2</li>
<li>Sub Menu 3</li>
</ul>
</li>
<li>Menu 3</li>
</ul>
</nav>
Fair enough, the suggestion to use the jQuery contextMenu plugin really is not bad. It can handle submenu's for you without a problem and really makes defining the command's quite a lot easier than writing it yourself.
http://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html
I am trying to create a webpage which is made up of a header and bellow the header a list of items. I want the list of items to be vertically scrollable. I also would like the webpage to take up the entire window but not be bigger. Currently my problem is the list of items is not scrollable and instead extends far below the bottom of the window and this is causing the window to be scrollable. What should the CSS properties be on the html, body, header and list items?
doctype html
html
head
link(href="css/style.css" rel="stylesheet")
body
div#wrapper
h1 Interactive Contact Directory
div(class="tools")
|Search:
br
input(type="text" id="searchBox")
select(name="searchBy" id="searchBy")
option(value='firstname') First Name
option(value='lastname') Last Name
option(value='email') Email
br
br
div(id="listingHolder")
ul(id="listing")
div(id="listingView")
Bellow is the current style sheet I have
html{
height: 100%;
}
body {
background:#121212;
margin:0px;
padding:0px;
font-family:"Open Sans", sans-serif;
height: 100%;
}
#wrapper {
max-height: 100%;
}
h1 {
margin:0px;
color:#fff;
padding:20px;
text-align:center;
font-weight:100;
}
.tools {
text-align:center;
color:#fff;
}
#searchBox {
padding:7px;
border:none;
border-radius:5px;
font-size:1.2em;
}
a.filter {
display:inline-block;
padding:5px 10px;
margin:5px;
background:#0472C0;
color:#fff;
text-decoration:none;
border-radius:3px;
}
a.filter:hover {
background:#0B9DE0;
color:#fff;
}
ul#listing {
list-style:none;
padding:0px;
margin:0px;
background:#fff;
width:100%;
}
ul#listing li {
list-style:none;
border-bottom:1px solid #eee;
display:block;
}
ul#listing li .list-header {
padding:10px;
cursor:pointer;
display:block;
}
ul#listing li .list-header:hover {
background:#7893AB;
color:#fff;
}
ul#listing li .list-header.active {
background:#447BAB;
color:#fff;
}
ul#listing li .details {
display:none;
background:#efefef;
padding:20px;
font-size:0.9em;
}
#listingHolder{
width: 50%;
overflow: scroll;
}
As per your question vertical listing have a scrollbar effect.
CSS / HTML :
nav ul{height:200px; width:18%;}
nav ul{overflow:hidden; overflow-y:scroll;}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<header>header area</header>
<nav>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Link 4</li>
<li>Link 5</li>
<li>Link 6</li>
<li>Link 7</li>
<li>Link 8</li>
<li>Link 9</li>
<li>Link 10</li>
<li>Link 11</li>
<li>Link 13</li>
<li>Link 13</li>
</ul>
</nav>
<footer>footer area</footer>
</body>
</html>
Another solution would be as below where the list is placed under a drop-down button.
<button class="btn dropdown-toggle btn-primary btn-sm" data-toggle="dropdown"
>Markets<span class="caret"></span></button>
<ul class="dropdown-menu", style="height:40%; overflow:hidden; overflow-y:scroll;">
{{ form.markets }}
</ul>
I have a strange menu to code and I have no idea how to do it, i have this 100% wide header strip, on the left side the logo sits and on the right the menu. The strip goes over fullscreen background. So, i need the active link to somehow crop the header strip, like make a hole. I attached an image so you can get a better idea. Thanks !
Here is the image:
http://oi49.tinypic.com/166zvo0.jpg
Use background opacity
HTML
<ul>
<li>Menu 1</li>
<li>Menu 2</li>
<li>Menu 3</li>
<li>Menu 4</li>
</ul>
CSS
body{
background:url(http://2.bp.blogspot.com/-C4Py3QDewmA/Td8HQzGhbcI/AAAAAAAAALU/BeVowacOJiA/s320/brick_wall.jpg) left top
}
li{
display:inline-block;
padding:10px;
border:1px solid black;
float:left;
background: rgba(255,255,255,0.60);
}
li:hover{
background:none
}
a{
color:white; font-weight:bold;
text-decoration:none
}
DEMO
I have a <ul> of items, who get bigger (with animation) on hover. Now i have made them be on the right side of the screen (using the CSS right:0em for the <li> class), and I have set the position of the <li> on hove to fixed so that only it will move left as it grows, and all the over objects in the will stay to the right. The problem is that as a result of that, when I hover over it, the next item gets "under" it. How can I change that? (maybe is there a way to control only the horizontal position property of the <li> on hover?)
Code:
http://jsfiddle.net/KBprd/2/
Without any code to start it is kind of hard to help. But based on what I could gather, you are wanting all the items to stay flush against the right side of the menu; only the "hovered" element is moved away from the right-side of the container. I've slapped together an example of how to do this. If this is not what you are looking for, provide some more code or detail in comments and we can go from there...
Here is the updated Fiddle
CSS:
.navigation{
position:fixed;
z-index:1;
top:3em;
right:0em;
}
.navigation li.slide{
color:#000000;
display:block;
padding: 0 10px;
line-height:30px;
margin-bottom:2px;
font-weight:light;
background:#00C9FF;
-webkit-transition: all .2s ease-in-out;
text-align:right;
width:53px;
float:right;
}
.navigation li:hover,.active{
font-size:25px;
cursor:pointer;
width:100px!important;
background:#5C0CE8;
}
.navigationClear {
clear:both;
height:1px;
margin-bottom:-1px;
}
HTML:
<ul class="navigation">
<li data-slide="1" class="slide">Slide 1</li>
<li class="navigationClear"></li>
<li data-slide="2" class="slide">Slide 2</li>
<li class="navigationClear"></li>
<li data-slide="3" class="slide">Slide 3</li>
<li class="navigationClear"></li>
<li data-slide="4" class="slide">Slide 4</li>
<li class="navigationClear"></li>
</ul>
The reason that your hovered element hides the element below is because you have given "position:fixed" to the hovered element. I fixed your problem by giving the ul element a width so that the li elements wont line up. I also removed the fixed position of the hovered element. and then right floated the li. This way you also dont need to put "clearNavigation" after each element.
Here's your fiddle code.
<ul class="navigation">
<li data-slide="1">Slide 1</li>
<li data-slide="2">Slide 2</li>
<li data-slide="3">Slide 3</li>
<li data-slide="4">Slide 4</li>
.navigation{
position:fixed;
z-index:1;
top:3em;
right:0em;
width:53px;
}
.navigation li{
color:#000000;
display:block;
padding: 0 10px;
line-height:30px;
margin-bottom:2px;
font-weight:light;
background:#00C9FF;
-webkit-transition: all .2s ease-in-out;
text-align:right;
width:53px;
position:relative;
right:0em;
float:right;
}
.navigation li:hover,.active{
font-size:25px;
cursor:pointer;
width:100px!important;
background:#5C0CE8;
right:0em;
}