Godfazzer
Godfazzer

Reputation: 11

ajax/jquery - Script that open simple popup window

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!

Upvotes: 1

Views: 15433

Answers (2)

user1983902
user1983902

Reputation: 434

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>';
}});

Upvotes: 2

Paul Fleming
Paul Fleming

Reputation: 24526

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();

Upvotes: 2

Related Questions