Solved

How to make the example JQuery Slidedown Panel slide over page content

Posted on 2008-10-17
2
17,387 Views
Last Modified: 2012-06-27
Hi All,

I am wanting to implement similar the following JQuery slide down panel but at the moment I can't work out how to make it slide over the top of my content rather than pushing the content down:

http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html

.. I think its to do with CSS layers but no success as yet.

Code attached for convenience too.

Many thanks,

Rit


<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Simple Slide Panel</title> 
 
<script type="text/javascript" src="jquery.js"></script> 
 
<script type="text/javascript"> 
$(document).ready(function(){
 
	$(".btn-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	 
});
</script> 
 
<style type="text/css"> 
body {
	margin: 0 auto;
	padding: 0;
	width: 570px;
	font: 75%/120% Arial, Helvetica, sans-serif;
}
a:focus {
	outline: none;
}
#panel {
	background: #754c24;
	height: 200px;
	display: none;
}
.slide {
	margin: 0;
	padding: 0;
	border-top: solid 4px #422410;
	background: url(images/btn-slide.gif) no-repeat center top;
}
.btn-slide {
	background: url(images/white-arrow.gif) no-repeat right -50px;
	text-align: center;
	width: 144px;
	height: 31px;
	padding: 10px 10px 0 0;
	margin: 0 auto;
	display: block;
	font: bold 120%/100% Arial, Helvetica, sans-serif;
	color: #fff;
	text-decoration: none;
}
.active {
	background-position: right 12px;
}
</style> 
</head> 
 
<body> 
 
<div id="panel"> 
	<!-- you can put content here --> 
</div> 
 
<p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p> 
 
</body> 
</html>

Open in new window

0
Comment
Question by:rito1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
sh0e earned 500 total points
ID: 22740464

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Simple Slide Panel</title> 
 
<script type="text/javascript" src="jquery.js"></script> 
 
<script type="text/javascript"> 
$(document).ready(function(){
 
        $(".btn-slide").click(function(){
                $("#panel").slideToggle("slow");
                $(this).toggleClass("active"); return false;
        });
        
         
});
</script> 
 
<style type="text/css"> 
body {
        margin: 0 auto;
        padding: 0;
        width: 570px;
        font: 75%/120% Arial, Helvetica, sans-serif;
}
a:focus {
        outline: none;
}
#panel {
        background: #754c24;
        height: 200px;
		width: 570px;
        display: none;
}
.slide {
        margin: 0;
        padding: 0;
        border-top: solid 4px #422410;
        background: url(images/btn-slide.gif) no-repeat center top;
		width: 570px;
}
.btn-slide {
        background: url(images/white-arrow.gif) no-repeat right -50px;
        text-align: center;
        width: 144px;
        height: 31px;
        padding: 10px 10px 0 0;
        margin: 0 auto;
        display: block;
        font: bold 120%/100% Arial, Helvetica, sans-serif;
        color: #fff;
        text-decoration: none;
		width: 570px;
}
.active {
        background-position: right 12px;
}
</style> 
</head> 
 
<body> 
 
<div style="position:absolute">
<div id="panel"> 
        <!-- you can put content here --> 
</div> 
 
<p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p> 
</div>
 
</body> 
</html>

Open in new window

0
 
LVL 1

Author Comment

by:rito1
ID: 22741061
Ah I see. It was actually a DIV that I was nesting this panel in that was causing the problem.

Thanks anyway.

Rit
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question