Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery转换只工作两次_Jquery_Loops_Rotation_Transition_Repeat - Fatal编程技术网

JQuery转换只工作两次

JQuery转换只工作两次,jquery,loops,rotation,transition,repeat,Jquery,Loops,Rotation,Transition,Repeat,我目前正在学习如何使用JQuery和Web设计 这个简单的开始是将.back预旋转到180度。 每3秒它将翻转180度,前后交换 由于某些原因,只能翻转到.back和.front一次。 有人知道为什么吗 我第一次从一个教程中找到这个设置,该教程显示了如何在悬停事件中翻转这些设置 这是我到目前为止所拥有的 <div class="flip-container"> <div class="flipper"> <div class="front"&

我目前正在学习如何使用JQuery和Web设计

这个简单的开始是将.back预旋转到180度。 每3秒它将翻转180度,前后交换

由于某些原因,只能翻转到.back和.front一次。 有人知道为什么吗

我第一次从一个教程中找到这个设置,该教程显示了如何在悬停事件中翻转这些设置

这是我到目前为止所拥有的

<div class="flip-container">
    <div class="flipper">
        <div class="front">
            <!-- front content -->
        </div>
        <div class="back">
            <!-- back content -->
        </div>
    </div>
</div>

<script>

    var deg = '180deg';

    function RotateFlipper()
    {
        $(".flipper").transition({rotateY: degree});
        deg = deg = '180deg' ? '0' : '180deg'
    }

    window.setInterval(RotateFlipper, 3000);

</script>

deg=deg='180deg'是打字错误吗?它似乎应该是deg=deg='180deg'deg=deg='180deg'?'0':'180deg'是ifdeg='180deg'deg='0'的缩写,否则deg='180'是的,但是当你说deg='180deg'时0':'180deg',三元运算符计算deg='180deg',将deg设置为'180deg',并返回'180deg',由于它是非空字符串,因此被解释为True。这将始终导致“0”返回。我相信你的意思是说deg=='180deg'作为一个比较,而不是一个作业。天哪,哈哈哈,我从来没有注意到我这么做过!度=度==“180度”?”0':“180度”