Forum Moderators: open

Message Too Old, No Replies

Prioritise JS

         

almo136

12:42 pm on Dec 9, 2015 (gmt 0)

10+ Year Member



On our home page we have a slideshow at the top of the page.

Further down the page we are using this plugin [instafeedjs.com...] to show recent images from our instagram feed.

The problem is the slideshow never loads until the instagram feed loads so we end up with a black space at the top of the page while it loads.

Is it possible to specify that we want the slideshow to load first?

Thanks!

Fotiman

4:37 pm on Dec 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How are you currently loading them?

almo136

4:59 pm on Dec 10, 2015 (gmt 0)

10+ Year Member



For the instafeed it is added in to the html body like this:
[evernote.com...]

For the slideshow the JS file is called in the head of the doc and then the slideshow is called using a widget in the site theme so not sure exactly how it is loaded.

Ideally I would like to set the instafeed to only load once the rest of the page is finished loading.

Fotiman

5:27 pm on Dec 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you using jQuery? If so:

$(function () {
var userFeed = new Instafeed({
...
});
userFeed.run();
});

This will cause that code to only run once the document is ready.

almo136

6:18 pm on Dec 10, 2015 (gmt 0)

10+ Year Member



Thanks!

almo136

10:16 am on Dec 11, 2015 (gmt 0)

10+ Year Member



Just realised it isn't working as the slideshow isn't loading first. Sometimes it isn't noticeable but occasionally the instagram feed doesn't load at all and when this happens the slideshow won't display.

Fotiman

2:37 pm on Dec 11, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is the slideshow dependant on images from the Instagram feed?

almo136

2:44 pm on Dec 11, 2015 (gmt 0)

10+ Year Member



No. It has it's own images. The images still appear in the source code but not on the page.

I actually think it could be something to do with my browser as when I check the same page from another laptop it seems to work fine.

Fotiman

3:44 pm on Dec 12, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd probably need to see how you're loading the slideshow code and whether they interact with the same DOM elements anywhere.