-1

I have a website in which there is one query which really slows down loading times. I would like use jQuery (perhaps?) to load the page, put a loading placeholder where the div will be, then load the div and run the php query.

There might be a problem in that, depending on what the php query finds, the div will be different sizes. So it would need to have an expand effect or something, not just a staticl sized placeholder.

I've had trouble even finding anything regarding this using searches. Any help or direction would be much appreciated.

Dan

4

1 回答 1

1

如果您将内容添加到您的 div 中,它会自动扩展,除非您专门将其设置为具有固定高度。此外,它会自动为您放置在其中的任何区域具有 100% 的宽度,除非您对其进行了不同的样式设置。

如果您的问题是您不希望 div 由于 AJAX 调用到服务器的潜在无限大小输出而超出某个点,那么您需要使用 max-height 属性设置 div 的样式。

于 2013-04-26T23:36:06.577 回答