Solved

How do you add a "load more videos" button

Posted on 2013-06-14
4
359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
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…
Suggested Courses

622 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