scrolltop

Animate scrollTop not working in firefox

匆匆过客 提交于 2019-11-25 23:47:00
问题 This function works fine. It scrolls the body to a desired container\'s offset function scrolear(destino){ var stop = $(destino).offset().top; var delay = 1000; $(\'body\').animate({scrollTop: stop}, delay); return false; } But not in Firefox. Why? -EDIT- To handle de double trigger in the accepted answer, I suggest stoping the element before the animation: $(\'body,html\').stop(true,true).animate({scrollTop: stop}, delay); 回答1: Firefox places the overflow at the html level, unless

向上轮播图 JavaScript

南笙酒味 提交于 2019-11-25 20:22:22
向上轮播图,新闻 ,公告轮播,记录一下,以后方便用 < html > < head > < title > vue < / title > < meta charset = "utf-8" > < script src = "https://cdn.jsdelivr.net/npm/vue" > < / script > < style > * { list - style : none ; padding : 0 px ; margin : 0 px ; } #hot - box { height : 30 px ; border : 1 px solid #ccc ; overflow : hidden ; width : 200 px ; margin : 50 px auto ; } #hot - box li { line - height : 30 px ; padding : 0 10 px ; height : 30 px ; } < / style > < / head > < body > < div id = "hot-box" > < ul id = "hot-content01" > < li > 1111 < / li > < li > 2222 < / li > < li > 3333 < / li > < li > 4444 < / li > <