Problemer med et PopUp script (fuldskærms / billed) til Guppy v4
Hejsa.Har et problem, hvor jeg har et script som åbner et vindue i fuldskærms og det vil jeg gerne have ændret sådan at det selv justere sig efter størrelsen på det billed der vises inde i popup'en.
Bruger en version af Guppy v.4 som modsat v.3 åbner alle popup vinduer i fuldskærms mode.
Har derfor 2 scripts der ligner hinanden meget, men jeg kan ikke hitte ud af hvad der gør at det ene følger størrelsen på objektet som åbnes, mens det andet bare fyre det op på en fuldscreen.
v4script;
<script type="text/javascript" language="JavaScript">
var x=(screen.width-1);
var y=(screen.height-1);
var popWin = null
var winCount = 0
var winName = "popWin"
function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
var d_winLeft = 0
var d_winTop = 0
winName = "popWin" + winCount++
closePopWin()
if (openPopWin.arguments.length >= 4)
winFeatures = "," + winFeatures
else
winFeatures = ""
if (openPopWin.arguments.length == 6)
winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
else
winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
popWin = window.open(winURL, winName, "width=" + winWidth
+ ",height=" + winHeight + winFeatures)
}
function closePopWin(){
if (navigator.appName != "Microsoft Internet Explorer"
|| parseInt(navigator.appVersion) >=4)
if(popWin != null) if(!popWin.closed) popWin.close()
}
function getLocation(winWidth, winHeight, winLeft, winTop){
return ""
}
function getLocation(winWidth, winHeight, winLeft, winTop){
var winLocation = ""
if (winLeft < 0)
winLeft = screen.width - winWidth + winLeft
if (winTop < 0)
winTop = screen.height - winHeight + winTop
if (winTop == "cen")
winTop = (screen.height - winHeight)/2 - 0
if (winLeft == "cen")
winLeft = (screen.width - winWidth)/2
if (winLeft>0 & winTop>0)
winLocation = ",screenX=" + winLeft + ",left=" + winLeft
+ ",screenY=" + winTop + ",top=" + winTop
else
winLocation = ""
return winLocation
}
</script>
gammel v3script(det det nye skal efterligne);
<SCRIPT Language="JavaScript">
var popWin = null
var winCount = 0
var winName = "popWin"
function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
var d_winLeft = 0
var d_winTop = 0
winName = "popWin" + winCount++
closePopWin()
if (openPopWin.arguments.length >= 4)
winFeatures = "," + winFeatures
else
winFeatures = ""
if (openPopWin.arguments.length == 6)
winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
else
winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
popWin = window.open(winURL, winName, "width=" + winWidth
+ ",height=" + winHeight + winFeatures)
}
function closePopWin(){
if (navigator.appName != "Microsoft Internet Explorer"
|| parseInt(navigator.appVersion) >=4)
if(popWin != null) if(!popWin.closed) popWin.close()
}
function getLocation(winWidth, winHeight, winLeft, winTop){
return ""
}
</SCRIPT>
<SCRIPT Language="JavaScript1.2">
function getLocation(winWidth, winHeight, winLeft, winTop){
var winLocation = ""
if (winLeft < 0)
winLeft = screen.width - winWidth + winLeft
if (winTop < 0)
winTop = screen.height - winHeight + winTop
if (winTop == "cen")
winTop = (screen.height - winHeight)/2 - 20
if (winLeft == "cen")
winLeft = (screen.width - winWidth)/2
if (winLeft>0 & winTop>0)
winLocation = ",screenX=" + winLeft + ",left=" + winLeft
+ ",screenY=" + winTop + ",top=" + winTop
else
winLocation = ""
return winLocation
}
</SCRIPT>