Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
想要为单个 div 标签创建分页,(即)如果文本长度超过 div 标签,那么它应该充当第 2 页等,如何做到这一点,您可以分享这些想法吗?
很明显,您在代码中的某个地方设置(或更改)内容,在设置内容之前,您应该检查新的长度。
var loadedData= new Array(); $.get('page.html', function(data){ loadedData= data.split('\n'); // or for example each data is in a paragraph: $(data).find("p").each(function(index){ loadedData[i]=$(this).html() }); });