JScript and CSS - Rotate by rotating the div instead of an image

0

Hello, I used a JavaScript library to rotate an image by clicking on it, in a javascript snippet I put what will spin when you click:
$("#conteudo").rotate({
The problem is that it's spinning the entire div :(
How can I put to run only the content of this div, I tried to put it like this:% $("#conteudo > img").rotate({ but it did not work :(, can you help me ?? Here is the project code by running the entire div:
link

    
asked by anonymous 26.09.2017 / 13:45

2 answers

1

According to the code of your link, the image is not inside the tag with id content and yes within the tag with id image, there are two ids image, and you must remove the id repeated, let's suppose you remove the id id of the img tag and just leave it on the external div, you should put in your jquery code this way:

$("#imagem > img")
    
26.09.2017 / 14:00
1

You could also use css instead of jquery but there you do not have onclick :

#conteudo > img:hover{ -ms-transform: rotate(7deg); /* IE 9 */ -webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */ transform: rotate(7deg); }

    
26.09.2017 / 14:23