Hi everyone, I was wondering if anyone could please tell me were to place a return false in this code so that when the pop-up is clicked it does not jump to the top of the page?
Code:
[ <script language="javascript"> function openYouTube(id){ //YouTube Player Parameters var width = 640; var height = 505; var FullScreen = "yes"; var AutoPlay = "yes"; var HighDef = "yes";
//Calculate Page width and height var pageWidth = window.innerWidth; var pageHeight = window.innerHeight; if (typeof pageWidth != "number"){ if (document.compatMode == "CSS1Compat"){ pageWidth = document.documentElement.clientWidth; pageHeight = document.documentElement.clientHeight; } else { pageWidth = document.body.clientWidth; pageHeight = document.body.clientHeight; } } // Make Background visible... var divbg = document.getElementById('bg'); divbg.style.visibility = "visible";
//Create dynamic Div container for YouTube Popup Div var divobj = document.createElement('div'); divobj.setAttribute('id',id); // Set id to YouTube id divobj.className = "popup"; divobj.style.visibility = "visible"; var divWidth = width + 4; var divHeight = height + 20; divobj.style.width = divWidth + "px"; divobj.style.height = divHeight + "px"; var divLeft = (pageWidth - divWidth) / 2; var divTop = (pageHeight - divHeight) / 2 - 10; //Set Left and top coordinates for the div tag divobj.style.left = divLeft + "px"; divobj.style.top = divTop + "px";
//Create dynamic Close Button Div var closebutton = document.createElement('div'); closebutton.style.visibility = "visible"; closebutton.innerHTML = "<span onclick=\"closeYouTube('" + id +"')\" class=\"close_button\">X</span>"; //Add Close Button Div to YouTube Popup Div container divobj.appendChild(closebutton);