Solved

pop up youtube video

Posted on 2011-02-13
3
291 Views
Last Modified: 2012-05-11
Hi Experts,

I 'd like to add a youtube video to a website.  I don't want the video displayed in the page, instead I'd like it to pop up into a smaller window and begin playing when the user clicks the link on the page.

Anyone know where I can get a simple free solution for this or any ideas on how I would write the script to do it?

Thanks,

HNM

0
Comment
Question by:HelpNearMe
[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
  • 3
3 Comments
 
LVL 2

Expert Comment

by:myr1
ID: 34882805
You can use this code to open it in a new window:
<a href="http://youtube.com" onclick="!window.open(this.href,'windowname','location=0,status=0,width=800,height=600')">Open YouTube</a>

Open in new window

0
 
LVL 2

Expert Comment

by:myr1
ID: 34882833
If you want to autoplay it, then add "&autoplay=1" at the end of the link.
(for example "http://www.youtube.com/v/OuSdU8tbcHY&autoplay=1")
0
 
LVL 2

Accepted Solution

by:
myr1 earned 500 total points
ID: 34882862
Sorry for the first post. There is a bug, which causes opening of the link in both windows. Try this:
<a href="http://www.youtube.com/v/OuSdU8tbcHY&autoplay=1" onclick="return(!window.open(this.href,'windowname','location=0,status=0,width=800,height=600'))" target="_blank">Open YouTube</a>

Open in new window

This should work even with JavaScript turned off (without setting the size of the window).
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
Embedd an image or live dashboard into Slack 1 55
Editing .asp website 5 35
Div not showing up 6 33
Checkbox changes display when resizing window 8 26
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
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…

752 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