0
用以下表達式瀏覽器屏幕立即移動到元素。如何爲瀏覽器屏幕的移動添加動畫?
jQuery(document).scrollTop(jQuery("#myelement").offset().top-500);
我該怎麼做同樣的事情,但通過動畫效果的速度? 以下表達式不起作用。
jQuery(document).scrollTop(jQuery("#myelement").offset().top-500).slow();
謝謝
嘗試'的jQuery(文檔).animate({scrollTop的:。jQuery的( 「#myelement」)偏移()頂500},'slow')'http://api.jquery.com/animate/ – Ejaz 2013-04-25 00:15:33
你不能只在語句中追加'slow',並期望減慢速度。這不是編程的工作方式。 – meagar 2013-04-25 00:39:27
不,它不起作用:/ – themis 2013-04-25 00:43:14