1

I need script that opens a popup window, like lightbox. but not with image

It must load video player code, from html file, and send video file ID to this code

Player code in html:

<iframe src="http://site.com/embed/video file ID" style="width: 800px; height: 450px; border: none; background-color: #000;" frameborder="0"></iframe>

So i need script to open popup window with code above.

Thanks!

1
  • Do you need a script or do you need help writing a script? Commented Jan 19, 2013 at 12:55

2 Answers 2

2

Fancybox does this really well. Version one is free to use.

Html:

<a class="forpopup" href="http://www.example?iframe">This goes to iframe</a>

JS:

$('a.forpopup').fancybox();
Sign up to request clarification or add additional context in comments.

Comments

2

See in jQuery ColorBox, in Demos Page find the Other Content Types section for outside HTML content via AJAX, Flash and video examples.

A brief example of usage:

// Format:
$(selector).colorbox({key:value, key:value, key:value});

// Examples:
// Image links displayed as a group
$('a.gallery').colorbox({rel:'gal'});

// Ajax
$('a#login').colorbox();

// Called directly, without assignment to an element:
$.colorbox({href:"thankyou.html"});

// Called directly with HTML
$.colorbox({html:"<h1>Welcome</h1>"});

// ColorBox can accept a function in place of a static value:
$("a.gallery").colorbox({rel: 'gal', title: function(){
    var url = $(this).attr('href');
    return '<a href="' + url + '" target="_blank">Open In New Window</a>';
}});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.