smfmetro10
asked on
How do you add a "load more videos" button
Hi,
I have a webpage that loads some videos from a youtube channel.
It works great. However, now I need a way to only show 9 at a time then have a button that when clicked will get nine more.
I have no idea how to do this. Any help will be greatly appreciated.
A working copy can be found at: http://thelocalized.com/fancybox/
I have attached my code for better clarification
index.html
I have a webpage that loads some videos from a youtube channel.
It works great. However, now I need a way to only show 9 at a time then have a button that when clicked will get nine more.
I have no idea how to do this. Any help will be greatly appreciated.
A working copy can be found at: http://thelocalized.com/fancybox/
I have attached my code for better clarification
index.html
ASKER
Thank you so much for the reply!!
Is there a way to "add" the videos, as opposed to only show 9 at a time.
So there would be 9 then when you push the load more video button there would be 18.. and so forth?
Thanks again for the help!
Is there a way to "add" the videos, as opposed to only show 9 at a time.
So there would be 9 then when you push the load more video button there would be 18.. and so forth?
Thanks again for the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Outstanding! Thanks!
A global javascript parameter : currIndex = 1; // current index 1 to start
A global javascript parameter : maxRes = 9; // max results 9
An URL parameter to specify the first to load :
https://developers.google.com/youtube/2.0/reference?hl=fr#start-indexsp
An URL parameter to specify how many to load (you already have this) :
https://developers.google.com/youtube/2.0/reference?hl=fr#max-resultssp
Check this SIMPLE test page : http://jsfiddle.net/X2Fea/