开发者

Load/Run "<php require...file.php..." After Rest of Page Has Loaded

开发者 https://www.devze.com 2023-03-29 00:55 出处:网络
On my website I have a image rotator. The page takes some time, it varies on how many pictures are in the slide show, to load the pictures. This delays the page and it takes more time to appear. Afte

On my website I have a image rotator. The page takes some time, it varies on how many pictures are in the slide show, to load the pictures. This delays the page and it takes more time to appear. After the page is finished loading how would I then be able to run this script? That way they could see the page, and then seconds later have this image rotator appear. The image rotator is not necessary so it's fine if it does not show up right away.

<php require(DIR开发者_运维技巧_WS_INCLUDES . 'slideshow.php'); ?>

I'll take any language, php, javascript or jquery, or ajax. I do not know ajax so if would be helpful if the answer was in one of the first two languages.

Thanks, Luc


PHP won't be a good solution for this - the whole PHP page will have been executed by the time the page is shown to the user.

Instead, you might look at JavaScript solutions - searching for JavaScript image carousel or rotator should lead you to many popular methods and libraries.

0

精彩评论

暂无评论...
验证码 换一张
取 消