据我所知,如果有的话
<div id="thing">OMG there's awesome stuff in here</div>
Run Code Online (Sandbox Code Playgroud)
并且需要在其他地方种植html,我可以选择使用:
$('#thing').html();或$('#thing').get(0);
使用其中一个是否有更高的互联网标准?他们完全一样,对吧?
谢谢您的帮助!
因此,就页面速度而言,我们都知道操纵页面会迫使它重绘,这对浏览器来说是一种负担。因此,如果我有一个应用了此 css 的 div:
div{
position: static;
}
Run Code Online (Sandbox Code Playgroud)
并将其更改为
div{
position: fixed;
}
Run Code Online (Sandbox Code Playgroud)
它将刷新页面并更改布局。我的问题是,如果 div 已经固定应用于它并且我执行
jQuery('div').css('position', 'fixed');
Run Code Online (Sandbox Code Playgroud)
它会导致重绘,还是只会看到它已经设置并继续它的快乐方式?
谢谢您的帮助!