Discuti il tutorial sul forum !
Sliding top con mootools
Step 1: HTML Code
HTML code is very simple: we have a DIV with ID "top-panel" which is the and a another layer with ID sub-panel which contains a link to slide up/dow our panel:
<div id="top-panel">
<!– Top Panel content here –>
</div>
<div id="sub-panel">
<a href="#" id="toggle"><span>Show Panel</span<</a>
</div>
<!– Top Panel content here –>
</div>
<div id="sub-panel">
<a href="#" id="toggle"><span>Show Panel</span<</a>
</div>
…remember to add mootools framework in the page <head> tag:
<script type="text/javascript" src="mootools.svn.js"></script>
Step 2: Css code
This is only a proposal about the look of your panel, but you can customize it how you prefer:
#top-panel{
background:#e8f3c6;
border-bottom:3px solid #a6c34e;
padding:14px 20px;
text-align:right;
}
#sub-panel{
text-align:center;
}
#sub-panel a{
width:150px;
float:right;
color:#FFFFFF;
text-decoration:none;
margin-right:30px;
font-weight:bold;
background:url(img/sub-left.png) bottom left no-repeat #a6c34e;
}
#sub-panel a span{
padding:6px;
background:url(img/sub-right.png) right bottom no-repeat;
display:block;
}
background:#e8f3c6;
border-bottom:3px solid #a6c34e;
padding:14px 20px;
text-align:right;
}
#sub-panel{
text-align:center;
}
#sub-panel a{
width:150px;
float:right;
color:#FFFFFF;
text-decoration:none;
margin-right:30px;
font-weight:bold;
background:url(img/sub-left.png) bottom left no-repeat #a6c34e;
}
#sub-panel a span{
padding:6px;
background:url(img/sub-right.png) right bottom no-repeat;
display:block;
}
Step 3: JavaScript Function
Add this simple JavaScript in the <head> tag of the page:
<script type="text/javascript">
window.addEvent(‘domready’, function(){
var mySlide = new Fx.Slide(‘top-panel’);
$(‘toggle’).addEvent(‘click’, function(e){
e = new Event(e);
mySlide.toggle();
e.stop();
});
});
</script>
window.addEvent(‘domready’, function(){
var mySlide = new Fx.Slide(‘top-panel’);
$(‘toggle’).addEvent(‘click’, function(e){
e = new Event(e);
mySlide.toggle();
e.stop();
});
});
</script>
Sito web: http://woork.blogspot.com/2008/03/sliding-top-panel-using-mootools_05.html
March 14, 2008 | Scritto in tutorials, script ajax
Letto:385 volte
Correlati
- Top 10 Web Developer Libraries
- Top 20 blog design
- Top 71 CSS Menus Navigation Tabs
- Pageflakes AJAX online desktop
- Hostingblog l'unico blog sull'hosting in italia
- Top 25 PHP template engines
- MooTools Mocha UI
- Le chiavi di ricerca più popolari del 2007 in Italia
- Top 10 Javascripts per manipulazione di immagini
- download 6900 comuni italiani
- Sliding top con mootools
- Top 12 CSS Frameworks
- sliding tabs
- sliding date picker
Commenti
Scrivi un commento














































