Solved

How do you add a "load more videos" button

Posted on 2013-06-14
4
358 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Make Float not to Wrap 15 66
Why am I getting SyntaxError: missing ; before statement error 39 82
jQuery element reference issue 2 38
Change background images after 5 seconds. 12 47
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…
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…

751 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