Solved

How do you add a "load more videos" button

Posted on 2013-06-14
4
357 Views
Last Modified: 2013-06-20
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
0
Comment
Question by:smfmetro10
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39250136
A button : <input type="button" value="load more video" />
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/
0
 

Author Comment

by:smfmetro10
ID: 39263457
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!
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39263475
0
 

Author Closing Comment

by:smfmetro10
ID: 39263516
Outstanding! Thanks!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I'm a Human captcha checkbox 13 39
JavaScript code not working 3 31
Any Way to rotate banner ads from Commission Junction? 2 36
Triple line in an alert message 4 19
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question