Jump to content

Recommended Posts

Posted

escrevi este código que faz esta coisa bonita.

http://exp.net84.net/jQuery%20Tutorial%20-%2076%20-%20Gallery%20Fading%20Effect/index.html

mas no entanto descobri algo que faz o mesmo mas de uma maneira diferente.

http://365supers.blogspot.pt/

as imagens tem um screw(acho que é isso) diferente.

Como posso fazer para tornar aleatório o screw.

Há sempre possibilidade de fazer um por um e nomeu caso não é dificil mas no caso do blogspot ia ser complicado.

"If It Ain't Broke, Break it and build something Cooler!" Unknown

Posted

https://developer.mozilla.org/en-US/docs/Javascript/Reference/Global_Objects/Math/random

http://code.google.com/p/jquery-rotate/

// usando jQuery + jQuery.rotate

function my_random(inf, sup) {
 return Math.random() * (sup - inf) - inf;
}

$(document).ready(funcition() {
 $("#imagens").rotate(my_random(-10.0, 10.0));
});

ps : não testado

IRC : sim, é algo que ainda existe >> #p@p
Posted (edited)

talvez :

function my_random(inf, sup) {
 return Math.random() * (sup - inf) - inf;
}

$(document).ready(funcition() {
 $("#imagens").css('transform', my_random(-10.0, 10.0)+'deg');
});
transform:rotate(7deg);

por outras palavras : não terás outra opção que usar javascript para a aleatoriedade (a não ser que o facas no servidor)

Edited by apocsantos
IRC : sim, é algo que ainda existe >> #p@p
Posted

mas aí estás a usar jquery se não me engano, eu estou a falar de CSS mesmo.

tal como isto

.fadeto {
   opacity: 0.5;
   transform: rotate(4deg) scale(0.7) skew(1deg) translate(10px);
   transition: all 0.3s ease-in 0s;
}

"If It Ain't Broke, Break it and build something Cooler!" Unknown

Posted (edited)

Dá para fazer com puro CSS

http://jsfiddle.net/AupNj/1/

agora estou é com um problema. tenho de descobrir a forma de como meter o rato em cima da imagem ela muda a opacidade de 50% para 100€ que já faz mas que também mude a rotation para 0º e e fique em evidência como no link que meti

http://exp.net84.net/jQuery%20Tutorial%20-%2076%20-%20Gallery%20Fading%20Effect/index.html

dando a ideia que aumentou

tenho muito o vicio de perguntar e só depois experimento em vezde fazer o contrário...

http://jsfiddle.net/AupNj/3/

será esta a melhor maneira?

Edited by sEnte

"If It Ain't Broke, Break it and build something Cooler!" Unknown

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.