Thursday, 5 July 2012

Creating jQuery Show/Hide Panel

Important: All scripts hosted on widcraft.googlecode.com don't work anymore because Google has blocked that SVN repository.

So today i'am going to teach you how to create jQuery Show/Hide Panel.....so let me start :

Java Script :


<script type="text/javascript" src="http://widcraft.googlecode.com/svn/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".flip").click(function(){
    $(".panel").slideToggle("slow");
  });
});
</script>


CSS :


<style>
div.panel,p.flip
{
margin:0px;
padding:5px;
width:600px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
width:600px;
height:100px;
display:none;
}
</style>


HTML :


<div class="panel">
<p>Show/Hide Panel Is Cool :p</p>
<p>Learn creating a jQuery show/hide panel at http://widcraft.blogspot.com .</p>
</div>
<p class="flip">Show/Hide Panel</p>

Ok so now let me explain you CSS with this pic :

Ok so finally here is the Full Script :

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://widcraft.googlecode.com/svn/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".flip").click(function(){
    $(".panel").slideToggle("slow");
  });
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
width:600px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
width:600px;
height:100px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>Show/Hide Panel Is Cool :p</p>
<p>Learn creating a jQuery show/hide panel at http://widcraft.blogspot.com .</p>
</div>
<p class="flip">Show/Hide Panel</p>
</body>
</html>

Important: Check our new website TricksPanda.com for WordPress tutorials, plugins and more.
 
Powered by Blogger.