Flipping an image with JS/Jquery

前端 未结 4 1073
春和景丽
春和景丽 2020-12-19 18:24

I am looking to flip an image. I have gotten the css to work using:

    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: sca         


        
4条回答
  •  我在风中等你
    2020-12-19 18:53

    I'd just use a class, like so:

    .flipped {
        -moz-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";
    }
    

    Then just swap the class:

    $("#chicken").delay(2000).fadeOut(1, function() {
        $(this).addClass('flipped').show()
               .animate({ left: 1600 + "px" , top : 2370 + "px"}, 5000, 'linear');
    });
    

    FIDDLE

提交回复
热议问题