Ti faccio vedere l'HTML e tutto il js perché l'animazione non và :/
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="mootools.svn.js"></script>
<script type="text/javascript" src="slider-menu.js"></script>
</head>
<body>
<div id="slider_container">
<ul id="slider">
<li id="kwick_red" class="chapter"><span>Red</span>
<li id="kwick_orange" class="chapter"><span>Orange</span>
<li id="kwick_yellow" class="chapter"><span>Yellow</span>
<li id="kwick_green" class="chapter"><span>Green</span>
<li id="kwick_blue" class="chapter"><span>Blue</span>
<!-- <li id="kwick_indigo" class="chapter"><span>Indigo</span>
<li id="kwick_violet" class="chapter"><span>Violet</span> -->
[/list]
</div>
</body>
</html>
Codice PHP:
window.addEvent('domready', function(){
var szNormal = 117, szSmall = 100, szFull = 219;
var kwicks = $$("#slider .chapter");
var fx = new Fx.Elements(kwicks, {wait: false, duration: 500, transition: Fx.Transitions.Back.easeOut});
kwicks.each(function(kwick, i){
kwick.setStyle('opacity',0.8);
});
kwicks.each(function(kwick, i) {
kwick.addEvent("click", function(event){
var container = $("#slider_container");
var fx = new Fx.Tween(container, {wait: false, duration: 500, transition: Fx.Transitions.Bounce.easeOut});
fx.start('height',300, 100);
});
kwick.addEvent("mouseenter", function(event) {
var o = {};
o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
kwick.setStyle('opacity',1);
kwicks.each(function(other, j) {
if(i != j) {
var w = other.getStyle("width").toInt();
if(w != szSmall) o[j] = {width: [w, szSmall]};
}
});
fx.start(o);
});
kwick.addEvent("mouseleave", function(event) {
var o = {};
kwicks.each(function(kwick, i) {
o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
kwick.setStyle('opacity',0.8);
});
fx.start(o);
});
});
});