|
  
|
|
|||||||
| Tutorials A collection of tutorials to help you with various programs. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Posts: n/a
Donate |
![]() Now for this solution I decided to use mootools due to the smoothness of their effects, however, this could just as easily be developed in script.aculo.us or other JavaScript libraries. Programs Used: -Aptana -MooTools *Notepad++ Works too. CSS Code HTML Code:
body{
position:relative;
paddign:0px;
font-size:100%;
}
h2{
color:#FFFFFF;
font-size:90%;
font-family:arial;
margin:10px 10px 10px 10px;
font-weight:bold;
}
h2 span{
font-size:105%;
font-weight:normal;
}
ul{
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
}
li{
margin:0px 10px 3px 10px;
padding:2px;
list-style-type:none;
display:block;
background-color:#DA1074;
width:177px;
}
li a{
width:100%;
}
li a:link,
li a:visited{
color:#FFFFFF;
font-family:verdana;
font-size:70%;
text-decoration:none;
display:block;
margin:0px 0px 0px 0px;
padding:0px;
width:100%;
}
li a:hover{
color:#FFFFFF;
text-decoration:underline;
}
#sideBar{
position: absolute;
width: auto;
height: auto;
top: 200px;
right:-7px;
background-image:url(images/background.gif);
background-position:top left;
background-repeat:repeat-y;
}
#sideBarTab{
float:left;
height:137px;
width:28px;
}
#sideBarTab img{
border:0px solid #FFFFFF;
}
#sideBarContents{
overflow:hidden !important;
}
#sideBarContentsInner{
width:200px;
}
HTML Code:
<div id="sideBar"> <a href="#" id="sideBarTab"> <img src="images/slide-button.gif" alt="sideBar" title="sideBar" /> </a> <div id="sideBarContents" style="width:0px;"> <div id="sideBarContentsInner"> <h2>side<span>bar</span></h2> <ul> <li><a href="#">Link One</a></li> <li><a href="#">Link Two</a></li> <li><a href="#">Link Three</a></li> <li><a href="#">Link Four</a></li> <li><a href="#">Link Five</a></li> </ul> </div> </div> </div> The sideBarContents DIV has an inline style applied setting the width to zero. This is to allow the JavaScript to resize the region using mootools (Some browsers are a bit buggy when trying to change styles that are set in an external stylesheet). This DIV is also set to have an overflow hidden producing the effect that the content is sliding in. Points to note within the CSS include the width set on the sideBarContentsInner DIV. This width should be adjusted as required to meet your deign requirements (It is set to 200px for the purpose of the demonstration). Also to reposition the bar simply adjust the postioning styles applied on the sideBar DIV (i.e. right and top). Finally you will need to include mootools.js and side-bar.js to the head of the document in the order shown for this to work. Download the Code |
|
| Remove Advertisements Sponsored Links | |
Advertisement |
|
![]() |
| Thread Tools | |
|
|
| |