Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

hostrl

com popup

Recommended Posts

Opa beleza? eu to criando um popup utilizo o script

 

<script type="text/javascript">

function abrir_img(){

window.open('xx.html', 'Visualizar Galeria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=no,width=450,height=350');

}

</script>

 

sim e chamo ele num onclick

 

<a href="#" onClick="abrir_img();"><img src="tal.jpg" width="86" height="63" border="0" /></a>

 

beleza no firefox ele chama a página certinho, mais no IE 7 ele da o erro e num abre nada e sim somente exib um erro de execção ali, causando erro de script

 

se algúem souber como me ajudar vlw!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá! eu uso este script aqui e funciona bem tanto no IE quanto no Mozila:

 

Primeiro você cria uma página "pop.htm" com a seguinte estrutura":

 

<html>
<head>
<title>Foto ampliada</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language='javascript'>
   var arrTemp=self.location.href.split("?");
   var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
   var NS = (navigator.appName=="Netscape")?true:false;

	 function FitPic() {
	   iWidth = (NS)?window.innerWidth:document.body.clientWidth;
	   iHeight = (NS)?window.innerHeight:document.body.clientHeight;
	   iWidth = document.images[0].width - iWidth;
	   iHeight = document.images[0].height - iHeight;
	   window.resizeBy(iWidth, iHeight);
	   self.focus();
	 };
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload='FitPic();'>

<script language='javascript'>document.write( "<img src='" + picUrl + "' border=0>" );</script>
</body>
</html>

Depois na página da foto você coloca este script nas tags <head></head>

<head>

<script>

<!--

<!--

function PopupPic(sPicURL) {

window.open( "pop.htm?"+sPicURL, "",

"resizable=1,height=300,width=300");

}

// -->

</script>

</head>

 

Daí pra você chamar a função use:

 

<a href="java script:;" onClick="PopupPic('images/suaimagem.jpg')"><img src="thumbs/suathumb.jpg>" border="0"></a>

 

Espero ter ajudado!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.