Speeding up the portfolio
Many times portfolio images are so large that it does not make sense to load them all on the page before they are being viewed. This demo continues from the previous demo so that a large image is loaded only when it's being viewed. In addition, the next and previous images are preloaded so that they can also be viewed quickly.
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
A Blue Flower
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur.
Wed Jun 10, 2:35 PM © John Doe
Images further down on the scrollable are not being loaded. The page responds quickly and the download time will be minimal. This is very important for artists because many times their images are very large.
Changing the HTML structure
We use a similar HTML structure as in the previous demo, but only one simple thing needs to be changed. We have modified the HTML structure for a single entry inside the overlay. We are not using a normal img tag which causes the image to be loaded on the page. Instead, we use a title attribute for the scrollable item to store the name of the image file.
JavaScript magic
Remember from our previous demo that when the overlay is opened, the scrollable is scrolled to the position that corresponds to the clicked thumbnail image. It is natural to create an onSeek callback function for the overlayed scrollable which is triggered every time the scrollable moves.
This callback uses the title attribute to dynamically create the image tag inside the scrollable item. Also, the tooltip effect is initialized at this point. We also do this for the next and previous items. This is only done once for each image as necessary.