Ir para conteúdo

POWERED BY:

Arquivado

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

designmix

Problema

Recommended Posts

Uma função em asp pra pegar os atributos do arquivo e ja manda no onclick o tamanho certo q ele abre direto a janela sem redimensionar.

 

Alguem sabe como faço ?

 

pois tenho um javascript que so funciona quando clica duas vezes

 

My Webpage

 

Valeu pela ajuda galera

Compartilhar este post


Link para o post
Compartilhar em outros sites

Uma função em asp pra pegar os atributos do arquivo e ja manda no onclick o tamanho certo q ele abre direto a janela sem redimensionar.Alguem sabe como faço ?pois tenho um javascript que so funciona quando clica duas vezesMy WebpageValeu pela ajuda galera

não entendi

Compartilhar este post


Link para o post
Compartilhar em outros sites

entra na pagina www.dpicriacao.com.br/teste/obras.asp e tanta abrir uma imagem o popup vai ,, abrir pequeno e na segunda vezes que você tenta vai mostrar normal

Compartilhar este post


Link para o post
Compartilhar em outros sites

galera eu tenho esse em php

PHP [/tr][tr]$arquivo = "imagens/$tb/$cod/$file";

$link = "../imagens/$tb/$cod/$file";

 

#### se for ter rolagem lateral. ####

// pega os atributos da imagem.

list($width, $height, $type, $attr) = getimagesize($arquivo);

$wd = $width+20;

 

<a href='java script:' onClick="MM_openBrWindow('alt_up_list_ver.php?img=<?=$link?>','','scrollbars=yes,width=<?=$wd;?>,height=400')">

 

#### se não for ter rolagem lateral. ####

// pega os atributos da imagem.

list($width, $height, $type, $attr) = getimagesize($arquivo);

<a href='java script:' onClick="MM_openBrWindow('alt_up_list_ver.php?img=<?=$link?>','','scrollbars=yes,width=<?=$width?>,height=<?=$height?>')">

[/tr]

Queria em asp nao sei nada de php

Compartilhar este post


Link para o post
Compartilhar em outros sites

Porque não usa só java script:<html><head><title>Título</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="window.resizeTo(document.imageTest.width+12,document.imageTest.height+30)" bgcolor="#ffffff"><center><img src="suaimagem.jpg" name="imageTest"></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu estou usando esse javascript mais esta dando pau<script>function abre(x){foto = window.open("","foto","width=0, height=0");foto.document.write("<body leftmargin='0' topmargin='0'>");foto.document.write("<img src='"+x+"' id='ft' />");foto.document.write("<script>window.resizeTo(ft.width,ft.height);<\/script>");}</script>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Para pegar as dimensões de uma imagem você pode usar um componente de imagens ou esse Script. Ou ainda usar JavaScript como disse o amigo mais acima.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tipo de erro:Erro de compilação do Microsoft VBScript (0x800A0400)Instrução esperada/poliaco/oi.asp, line 178&njsp; end if
ASP [/tr][tr]<%

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objF = objFSO.GetFolder("fotos/")

Set objFC = objF.Files

 

response.write "<table border=""0"" cellpadding=""5"">"

 

For Each f1 in objFC

if instr(ucase(f1.Name), ".JPG") then

response.write "<tr><td>" & f1.name & "</td><td>" & f1.DateCreated & "</td><td>" & f1.Size & "</td><td>"

 

if gfxSpex(f1.Path, w, h, c, strType) = true then

response.write w & " x " & h & " " & c & " colors"

else

response.write " "

end if

 

response.write "</td></tr>"

 

end if

 

Next

 

response.write "</table>"

 

set objFC = nothing

set objF = nothing

set objFSO = nothing

 

'##############################################

 

function GetBytes(flnm, offset, bytes)

 

Dim objFSO

Dim objFTemp

Dim objTextStream

Dim lngSize

 

on error resume next

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

 

' First, we get the filesize

Set objFTemp = objFSO.GetFile(flnm)

lngSize = objFTemp.Size

set objFTemp = nothing

 

fsoForReading = 1

Set objTextStream = objFSO.OpenTextFile(flnm, fsoForReading)

 

if offset > 0 then

strBuff = objTextStream.Read(offset - 1)

end if

 

if bytes = -1 then ' Get All!

 

GetBytes = objTextStream.Read(lngSize) 'ReadAll

 

else

 

GetBytes = objTextStream.Read(bytes)

 

end if

 

objTextStream.Close

set objTextStream = nothing

set objFSO = nothing

 

end function

 

 

function lngConvert(strTemp)

lngConvert = clng(asc(left(strTemp, 1)) + ((asc(right(strTemp, 1)) * 256)))

end function

 

function lngConvert2(strTemp)

lngConvert2 = clng(asc(right(strTemp, 1)) + ((asc(left(strTemp, 1)) * 256)))

end function

 

 

function gfxSpex(flnm, width, height, depth, strImageType)

 

dim strPNG

dim strGIF

dim strBMP

dim strType

strType = ""

strImageType = "(unknown)"

 

gfxSpex = False

 

strPNG = chr(137) & chr(80) & chr(78)

strGIF = "GIF"

strBMP = chr(66) & chr(77)

 

strType = GetBytes(flnm, 0, 3)

 

if strType = strGIF then ' is GIF

 

strImageType = "GIF"

Width = lngConvert(GetBytes(flnm, 7, 2))

Height = lngConvert(GetBytes(flnm, 9, 2))

Depth = 2 ^ ((asc(GetBytes(flnm, 11, 1)) and 7) + 1)

gfxSpex = True

 

elseif left(strType, 2) = strBMP then ' is BMP

 

strImageType = "BMP"

Width = lngConvert(GetBytes(flnm, 19, 2))

Height = lngConvert(GetBytes(flnm, 23, 2))

Depth = 2 ^ (asc(GetBytes(flnm, 29, 1)))

gfxSpex = True

 

elseif strType = strPNG then ' Is PNG

 

strImageType = "PNG"

Width = lngConvert2(GetBytes(flnm, 19, 2))

Height = lngConvert2(GetBytes(flnm, 23, 2))

Depth = getBytes(flnm, 25, 2)

 

select case asc(right(Depth,1))

case 0

Depth = 2 ^ (asc(left(Depth, 1)))

gfxSpex = True

case 2

Depth = 2 ^ (asc(left(Depth, 1)) * 3)

gfxSpex = True

case 3

Depth = 2 ^ (asc(left(Depth, 1))) '8

gfxSpex = True

case 4

Depth = 2 ^ (asc(left(Depth, 1)) * 2)

gfxSpex = True

case 6

Depth = 2 ^ (asc(left(Depth, 1)) * 4)

gfxSpex = True

case else

Depth = -1

end select

 

 

else

 

strBuff = GetBytes(flnm, 0, -1) ' Get all bytes from file

lngSize = len(strBuff)

flgFound = 0

 

strTarget = chr(255) & chr(216) & chr(255)

flgFound = instr(strBuff, strTarget)

 

if flgFound = 0 then

exit function

end if

 

strImageType = "JPG"

lngPos = flgFound + 2

ExitLoop = false

 

do while ExitLoop = False and lngPos < lngSize

 

do while asc(mid(strBuff, lngPos, 1)) = 255 and lngPos < lngSize

lngPos = lngPos + 1

loop

 

if asc(mid(strBuff, lngPos, 1)) < 192 or asc(mid(strBuff, lngPos, 1)) > 195 then

lngMarkerSize = lngConvert2(mid(strBuff, lngPos + 1, 2))

lngPos = lngPos + lngMarkerSize + 1

else

ExitLoop = True

&njsp; end if

 

loop

'

if ExitLoop = False then

 

Width = -1

Height = -1

Depth = -1

 

else

 

Height = lngConvert2(mid(strBuff, lngPos + 4, 2))

Width = lngConvert2(mid(strBuff, lngPos + 6, 2))

Depth = 2 ^ (asc(mid(strBuff, lngPos + 8, 1)) * 8)

gfxSpex = True

 

end if

 

end if

 

end function

%>

[/tr]

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.