Search
 
SCRIPT & CODE EXAMPLE
 

CSS

transform on click

/*If you want a css only solution you can use active*/
.crossRotate:active {
   transform: rotate(45deg);
   -webkit-transform: rotate(45deg);
   -ms-transform: rotate(45deg);
}

/*But the transformation will not persist when the activity moves. 
For that you need javascript (jquery click and css is the cleanest IMO).*/

<script>
$( ".crossRotate" ).click(function() {
    if (  $( this ).css( "transform" ) == 'none' ){
        $(this).css("transform","rotate(45deg)");
    } else {
        $(this).css("transform","" );
    }
});
</script>
Comment

PREVIOUS NEXT
Code Example
Css :: webpack animate.css 
Css :: cs cirlce 
Css :: how to style rule to apply the Border Box model css 
Css :: css hover rounded corners 
Css :: css line-height default 
Css :: sass installation 
Css :: animation css 
Css :: input focus css default 
Css :: css animations 
Css :: css when i add a border radius to input problem 
Css :: css change the accordion arrow color 
Css :: make text available only to screen reader 
Css :: change parent div css on over of child 
Css :: overflow-wrap: anywhere 
Css :: tampermonkey custom css 
Css :: css two classes together 
Css :: css stands for 
Css :: css italics 
Css :: print zend db select query to string 
Css :: Giving body maximum width in css 
Css :: css box 
Css :: @media for react style css 
Css :: css multiline comment 
Css :: buttons have strange style iOS 
Css :: video failing to scale with div css background 
Css :: how to change color of hyperlink in css 
Css :: can i merge background image background-image css 
Css :: page rotate css 
Css :: css gap 
Css :: css cursor pointer 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =