I am trying to call two functions in my script, but it will only call one or the other. Any help?
[code=php]<script type=”text/javascript”>
function showPopUp(el) {
var cvr = document.getElementById(“cover”)
var dlg = document.getElementById(el)
cvr.style.display = “block”
dlg.style.display = “block”
if (document.body.style.overflow = “hidden”) {
cvr.style.width = “100%”
cvr.style.height = “100%”
}
}
function showPopUp1() {
window.open(‘http://www.freeseamlesstiles.com/mailcode18/index.php’, ‘newwin’, ‘width=500,height=500,resizable=no,scrollbars=no,toolbars=no,location=no,directories=no,status=no,menubar=no,copyhistory=no’);
}
function bothcalls() {
showPopUp(el)
showPopUp1(el)
}
</script>
And I call with:
[code=php]<a href=”#” onclick=”bothcalls()”><img src=”/_gfx/add.gif” border=”0″ alt=”add tile” align=”left”> Add a Tile</a>
It will not work this way. But if I use:
[code=php]<a href=”#” onclick=”showPopUp(‘el’)”><img src=”/_gfx/add.gif” border=”0″ alt=”add tile” align=”left”> Add a Tile</a>
or
[code=php]<a href=”#” onclick=”showPopUp1()”><img src=”/_gfx/add.gif” border=”0″ alt=”add tile” align=”left”> Add a Tile</a>
It will work and only call that one function.
The first function darkens the screen while the second brings up a popup.