Ciao ho scaricato da questo sito un Js che permette di creare una galleria di foto icone che quando vengono cliccate fanno aprire una finestra con la foto nelle dimensioni originali, ma tale finestra risultava quasi sempre mezza fuori dallo spazio del monitor, allora ho modificato il codice dandogli dei punti assoluti (50 e 20 ) per l'apertura, ma mi funziona solo in explorer, in firefox è come se non avessi modificato niente, mi dite dove devo agire. Grazie
<!--
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
function enlarge(which,e){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX : 50
crossobj.style.top=ns6? pageYOffset+e.clientY : 20
crossobj.innerHTML='<div align=right id=drag><SPAN STYLE="cursorointer"><font face="verdana" color="#ff0000" size="2"><b onClick=closepreview()>X[/b]</font></span></div>[img]'+which+'[/img]'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('[img]'+which+'[/img]')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
else
return true
}
function closepreview(){
crossobj.style.visibility="hidden"
}
var nsx,nsy,nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}
function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id =="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//-->
head
body
<td><a href="images/tuttefoto/ADRIA1_G.gif" onClick="return enlarge('images/tuttefoto/ADRIA1_G.gif',event)">
[img]images/tuttefoto/ADRIA1_P.gif[/img]</a></td>