HTML5 MP3 Player Radio KPlayer

Open ColorBox from iFrame to Parent Window

On June 26, 2012, in Javascript, jQuery, LAMP, Learning, by Sandeep Verma

Hits: 5189  

function iframecode(url, w, h) {
window.parent.$.colorbox({href:url, iframe: true, scrolling: false, width: w, height: h});

}

var headID = window.parent.document.getElementsByTagName("head")[0];         
var newScript = window.parent.document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
headID.appendChild(newScript);

var headID = window.parent.document.getElementsByTagName("head")[0];         
var cssNode = window.parent.document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'http://demo.svnlabs.com/colorbox/example3/colorbox.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);

var headID = window.parent.document.getElementsByTagName("head")[0];         
var newScript = window.parent.document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://demo.svnlabs.com/colorbox/colorbox/jquery.colorbox.js';
headID.appendChild(newScript);

Uses:
onClick=”iframecode(‘http://www.svnlabs.com/’, ‘80%’, ‘80%’);”







Tagged with:  

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...