jQuery Slide Toggle

I have a div that I want to show when I click a button.  I want the div to slide down over the other content, not push it down.  I'm not 100% sure how to do this.  What I have here will reveal the div, but it pushes everything down.

<script>
jQuery(document).ready(function() {
	jQuery('.laser-nav-display').click(function() {
		jQuery('.nav-lasers').slideToggle("slow", function() {
			
		});
	});
});
</script>

<style>
header	{
	width:100%;
	min-height:100px;
	max-height: 279px;
	padding:0 0 23px 0;
	position:relative;
	clear:both;
	background-image:url('../images/site_images/header-fade.png');
	background-repeat:repeat-x;
	position:relative;
	z-index:1;
}

.nav-lasers {
	width:100%;
	min-height:400px;
	position:relative;
	z-index:100;
	display:none;
	top:100px;
}
</style>

<html>
<header>
	<nav>
		<ul>
			<li class="laser-nav-display">PRODUCTS</li>
                </ul>
	</nav>

	<div class="nav-lasers" style>
	 <h1>HELLO</h1>
	</div>
</header>
</html>

Open in new window

LVL 7
rgranlundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Here is a starting point
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script>
jQuery(document).ready(function() {
	jQuery('.laser-nav-display').click(function() {
		jQuery('.nav-lasers').slideToggle("slow", function() {
		});
	});
});
</script>

<style>
header	{
	width:100%;
	min-height:100px;
	max-height: 279px;
	padding:0 0 23px 0;
	position:relative;
	clear:both;
	background-image:url('../images/site_images/header-fade.png');
	background-repeat:repeat-x;
	position:relative;
	z-index:1;
}

.nav-lasers {
	display:none;
}
</style>
</head>
<body>
<header>
	<nav>
		<ul>
			<li class="laser-nav-display">PRODUCTS</li>
                </ul>
	</nav>

	<div class="nav-lasers">
	 <h1>HELLO</h1>
	</div>
</header>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jessica WhitleySoftware DeveloperCommented:
I think the best term is you are looking for a modal type of component.
Jquery and bootstrap both offer great options without a ton of extra work.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.