问答详情
源自:4-3 transition 实现轮播效果实战

平滑的过渡效果没显示

$('#nextBtn').mouseenter(()=>{

            if(intIntedex===listlength){

                intIntedex=0;

                $content.css({

                    "transition":`none`,

                    "transform":`translateX(-${outerWidth*intIntedex}px)`

                })

            }

        })


        $('#nextBtn').click(()=>{

            intIntedex++;

            $content.css({

                'transition':`tranform ${transitionTime}s ease`,

                'transform':`translateX(-${outerWidth*intIntedex}px)`

            })

            intIntedex === listlength?intIntedex=0:'';


        })


提问者:慕村2975968 2020-01-21 20:59

个回答

  • 慕移动3419986
    2020-03-06 18:38:40

    倒数第五行是:transform 书写错误

  • 慕村2975968
    2020-01-22 08:17:38

    倒数第五行是:'transition':`transform ${transitionTime}s ease`,