Salve, mi servirebbe aiuto per uno script che mi permetta di far muovere in direzioni diverse 3 immagini sovrapposte in modo tale che si vedano e nel nel mentre quelle sotto devono ruotare una a destra e una a sinistra. Il tutto in loop.
Ho trovato questo codice che mi permette di muoverle verso alto e sinistra o destra. Mi manca la rotazione però
Grazie in anticipo ciaoCodice PHP:// JavaScript Document $(document).ready(function(e) {
var idTimer;
var c, m, y;
var radianti=0, incremento=Math.PI*2/30;
$("div").click(function(e) {
if(!$(this).hasClass("active"))
{
window.location.hash=$(this).attr("data-id").toLowerCase(); _gaq.push(['_trackPageview', '/'+$(this).attr("data-id").toLowerCase()]); $("body").css({"overflow":"hidden"}); $(this).addClass("active").children(".background").eq(0).stop(true).animate({opacity:1,backgroundColor:"#e6097b"},10000,"swing");
$(".page[id="+$(this).attr("data-id")+"]").stop(true).css({top:"50%","opacity":0,"display":"block"}).delay(500).fadeTo(1000,1,"swing");
if($(this).attr("data-id")=="home")
{
idTimer=setInterval(updateBalls,1000/30);
}
else
{
clearInterval(idTimer);
}}
});
$("#menu > li > div,#social > li > div").hover(
function(e) {
if(!$(this).hasClass("active"))
{ $(this).children(".background").eq(0).stop(true).animate({opacity:1,backgroundColor:"#660035"},500,"swing"); $(this).children(".caption").stop(true).animate({height:"14px"},200,"swing");
}
},function(e)
{
if(!$(this).hasClass("active"))
{ $(this).children(".background").eq(0).stop(true).animate({opacity:0.6,backgroundColor:"#000"},500,"swing"); $(this).children(".caption").stop(true).animate({height:"0px"},200,"swing");
}
});
var found=false;
if(window.location.href.indexOf("#")>=0) {
var anchorPage=window.location.href.split('#')[1];
$("#menu > li > div").each(function(index, element) {
if($(this).attr("data-id").toLowerCase()==anchorPage.toLowerCase()) {
$(this).mouseenter().click();
found=true;
}
});
}
function updateBalls() {
radianti+=incremento;
c.css(
{
"left":Math.cos(radianti)*25+"px",
"top":Math.sin(radianti)*20+"px"
});
m.css(
{
"left":Math.cos(radianti+Math.PI*2/3)*60+"px",
"top":Math.sin(radianti+Math.PI*2/3)*15+"px"
});
y.css(
{
"left":Math.cos(radianti+Math.PI*4/3)*20+"px",
"top":Math.sin(radianti+Math.PI*4/3)*45+"px"
});
}
c=$("#c");
m=$("#m");
y=$("#y"); });

Rispondi quotando