Slideout Sidebar

Developer
Size
3,596 Kb
Views
38,456

How do I make an slideout sidebar?

A slideout sidebar. Trying to fix a bug.. What is a slideout sidebar? How do you make a slideout sidebar? This script and codes were developed by Billy Brown on 30 September 2022, Friday.

Slideout Sidebar Previews

Slideout Sidebar - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Slideout Sidebar</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { box-sizing: border-box; margin: 0; padding: 0;
}
#sidebar { background: #eee; border-right: 1px solid #555; height: 100%; left: 0; padding: 50px; position: fixed; top: 0; transition: all linear .2s; width: 200px;
}
#sidebar .arrow-box { background: #eee; border: 1px solid #555; cursor: pointer; display: block; height: 20px; left: 49%; position: absolute; text-align: center; transform: rotate(90deg); width: 40px; border-bottom: none; top: 100px; left: 189px;
}
#sidebar .arrow-box .arrow { border-left: 10px solid transparent; border-right: 10px solid transparent; height: 0; position: absolute; width: 0; top: 5px; left: 8px; width: 10px;
}
#sidebar .arrow-box .arrow.dir-one { border-top: 10px solid #555;
}
#sidebar .arrow-box .arrow.dir-two { border-bottom: 10px solid #555;
}
#content { padding-left: 200px; padding-top: 10px; position: relative; transition: all linear .2s; width: 100%; z-index: -1000;
}
#guts { border: 1px solid #555; font-family: "Baskerville", Georgia, serif; margin: 0 auto; padding: 30px; width: 70%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="sidebar">	<div class="arrow-box"> <div class="arrow dir-one"></div> </div>	<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul>
</div>
<div id="content">	<div id="guts">	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>	</div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Slideout Sidebar - Script Codes CSS Codes

* { box-sizing: border-box; margin: 0; padding: 0;
}
#sidebar { background: #eee; border-right: 1px solid #555; height: 100%; left: 0; padding: 50px; position: fixed; top: 0; transition: all linear .2s; width: 200px;
}
#sidebar .arrow-box { background: #eee; border: 1px solid #555; cursor: pointer; display: block; height: 20px; left: 49%; position: absolute; text-align: center; transform: rotate(90deg); width: 40px; border-bottom: none; top: 100px; left: 189px;
}
#sidebar .arrow-box .arrow { border-left: 10px solid transparent; border-right: 10px solid transparent; height: 0; position: absolute; width: 0; top: 5px; left: 8px; width: 10px;
}
#sidebar .arrow-box .arrow.dir-one { border-top: 10px solid #555;
}
#sidebar .arrow-box .arrow.dir-two { border-bottom: 10px solid #555;
}
#content { padding-left: 200px; padding-top: 10px; position: relative; transition: all linear .2s; width: 100%; z-index: -1000;
}
#guts { border: 1px solid #555; font-family: "Baskerville", Georgia, serif; margin: 0 auto; padding: 30px; width: 70%;
}

Slideout Sidebar - Script Codes JS Codes

$(function() {	var s = 0;	$('#sidebar .arrow-box').click(function() {	if (s == 0) {	s = 1;	$('#sidebar').css('left', '-200px');	$('#sidebar .arrow').removeClass('dir-one');	$('#sidebar .arrow').addClass('dir-two');	$('#content').css('padding-left', '0');	} else {	s = 0;	$('#sidebar').css('left', '0');	$('#sidebar .arrow').addClass('dir-one');	$('#sidebar .arrow').removeClass('dir-two');	$('#content').css('padding-left', '200px');	}	});
});
Slideout Sidebar - Script Codes
Slideout Sidebar - Script Codes
Home Page Home
Developer Billy Brown
Username _Billy_Brown
Uploaded September 30, 2022
Rating 3.5
Size 3,596 Kb
Views 38,456
Do you need developer help for Slideout Sidebar?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Billy Brown (_Billy_Brown) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!