简体   繁体   中英

Javascript image gallery - too many images and page loads very slow

I have an image gallery. It is powered by highslide and page contains the resized images previews (for example 100x100px, when you click on preview, fullsized picture is displayed, but that is not important...).

Images are uploaded to the gallery by users, and problem is, that on some point, about approximately 100 images on one page (=100 images which need to be resized by webbrowser for preview), page is loading VERY slow and freezes all the time.

Q1: Is there any javascript which will display for example FIRST 40 pictures (first 40 lines of a file) and other pictures will not be loaded? When I click 'next' it will display pictures 40-80, then 80-120... I dont even know if something like this is possible.

Q2: Or a javascript, which will load only pictures which are currently on the view? I found that one, it works fine, but when I scroll down to the end of my gallery, all the images have gone through my viewpoint, so they are loaded all... and it freezes aggain.

Q3: Or a script that will automaticly devide my page to tabs(each tab with defined file length)?

Thanks for every solution!

/EDIT To: Frits van Campen I have tried Lazy Load - http://www.appelsiini.net/projects/lazyload , but deviding into tabs would be more usefull.

//EDIT TO: Mörre I know that it would be much better if images was already resized and stored on my server, but either the original-sized images arent stored on my server, I have only src address of them.

只需减小图像尺寸即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM