1

大家好,我目前正在开发这个网站

它几乎完成了,但是当您单击“Eventos” div 时我遇到了一些问题,有时动画很慢,有时它会崩溃,我不知道为什么。

这是我的代码中执行动画的部分。

 case 'Eventos':
           if(cargado == true){
             if(banderapuntoventa == true){
                    $("#cuartimg").removeClass('forzadapv')
                    $("#puntosdeventadiv").stop(true,false).animate({"top": "1500px"}, 1500,"easeOutSine",function(){
                        banderaeventos = true;
                        $("#eventosydemas").css({"margin-right": '97%', "right": '10px'})
                        $("#eventos").stop(true,false).animate({"left": "0"}, 1500,"easeOutSine",function(){
                            $('body').css('overflow', 'hidden')
                            $("#esctop,#escbot").stop(true,false).fadeOut(400)
                            $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                            $("#header").css({"height": '100px'})
                            $("#eventos").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                        })
                    })
                    $("#esctop,#escbot").stop(true,false).fadeIn(400)
                    $("#esctop2,#escbot2").stop(true,false).fadeOut(400)
                    $("#header").css({"height": '100px'})
                    banderapuntoventa = false;


                }
                else{

                    banderaeventos = true;
                    $("#eventosydemas").css({"margin-right": '97%', "right": '10px'})
                    $("#eventos").stop(true,false).animate({"left": "0"}, 2000,function(){
                    $('body').css('overflow', 'hidden')
                            $("#esctop,#escbot").stop(true,false).fadeOut(400)
                            $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                            $("#header").css({"height": '100px'})
                            $("#eventos").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})

                })

                }
            }
            else{
                $(".dial").knob({
                    readOnly:true
                });

                iniloader(50);
                banderaeventos = true;

                    $("#eventos").stop(true,false).animate({"left": "0"}, 1500,"easeOutSine",function(){
                        $("#esctop,#escbot").stop(true,false).fadeOut(400)
                        $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                        $("#header").css({"height": '100px', "background": 'none'})
                        $('body').css('overflow', 'hidden')
                        $("#eventos").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                    })

            }

          break;


case 'PuntosdeVenta':
           if(cargado == true){
              if(banderaeventos == true){

                    $("#cuartimg").removeClass('forzadapv')
                     $("#eventosydemas").animate({"margin-right": "0px","right":"0px"}, 1500)
                    $("#eventos").stop(true,false).animate({"left": "100%"}, 1500,"easeOutSine",function(){

                        banderapuntoventa = true;
                        $("#cuartimg").addClass('forzadapv')
                        $("#puntosdeventadiv").stop(true,false).animate({"top": "0"}, 1500,"easeOutSine",function(){
                            $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                            $("#esctop,#escbot").stop(true,false).fadeOut(400)
                            $("#header").css({"height": '100px'})
                            $('body').css('overflow', 'hidden')
                            $("#puntosdeventadiv").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                        })

                    })
                    $("#esctop2,#escbot2").stop(true,false).fadeOut(400)
                    $("#esctop,#escbot").stop(true,false).fadeIn(400)
                    banderaeventos = false;

                }
                else if(banderascroll == false){
                    $(".hoverini").removeClass('focusmenu')
                    $("#cuartimg").addClass('forzadapv')
                    $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                    $("#esctop,#escbot").stop(true,false).fadeOut(400)
                    $("#puntosdeventadiv").stop(true,false).animate({"top": "0"}, 2000,function(){
                        $("#header").css({"height": '100px'})
                        $('body').css('overflow', 'hidden')
                        $("#puntosdeventadiv").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                    })
                }
                else{

                    banderapuntoventa = true;
                    $("#cuartimg").addClass('forzadapv')
                    $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                    $("#esctop,#escbot").stop(true,false).fadeOut(400)
                    $("#puntosdeventadiv").stop(true,false).animate({"top": "0"}, 2000,function(){
                        $("#header").css({"height": '100px'})
                        $('body').css('overflow', 'hidden')
                        $("#puntosdeventadiv").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                    })

                }
            }
            else{

                $(".dial").knob({
                    readOnly:true
                });

                iniloader();
                banderapuntoventa = true;
                    $("#puntosdeventadiv").stop(true,false).animate({"top": "0"}, 1500,"easeOutSine",function(){
                        $("#esctop,#escbot").stop(true,false).fadeOut(400)
                        $("#esctop2,#escbot2").stop(true,false).fadeIn(400)
                        $("#header").css({"height": '100px'})
                        $('body').css('overflow', 'hidden')
                        $("#puntosdeventadiv").stop(true,false).animate({scrollTop: $(window).scrollTop() + 1},function(){})
                    })

            }

          break;
4

0 回答 0