Avatar billede gruppe422 Nybegynder
07. november 2002 - 22:13 Der er 16 kommentarer og
1 løsning

Hjælp til Photo Album i ASP

Hejsa

Jeg sidder og knokler med et Foto Album i ASP, men kan ikke helt få det til at virke. Foto Albummet består af to sider "PhotoAlbum.asp" og "ShowPicture.asp". Hvis vi starter med PhotoAlbum.asp, kunne jeg godt tænke mig at dropdown menuen samt 1,2,3,4 (antal sider), kom ned og stå i bunden af siden. Plus at den tekst der står under billedet evt. blev fjernet.

Hvad angår ShowPicture.asp, som er den side billedet popper frem på, når du har klikket på billedet i PhotoAlbum.asp. Skal det være sådan, at når man klikker på billedet, lukker vinduet!. Og så skal den der dropdown menu heller ikke være der, tilbage linket skal væk og så skal vinduet være centreret.

på forhånd tak..



------------------------------
PhotoAlbum.asp
------------------------------

<%

' PhotoAlbum

Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath


Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray()
intPicsPerRow  = 4
intPicsPerPage = 4

intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
    intPage = 1
End If

CurFile = "PhotoAlbum.asp"
PopFile = "ShowPicture.asp"
%>
<link rel="stylesheet" type="text/css" href="style.css">
<style>

a:link {
    color: #172166;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:visited {
    color: #172166;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:active {
    color: #FF0000;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:hover {
    color: #FF0000;
    text-decoration: underline;
    font-size: 12px;
    font-weight: bold;
}

</style>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}
// -->
</script>
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openGalleryWindow(url) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
    var xOffset = 100, yOffset = 100;

    popupWin =

window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+

',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
// done hiding -->
</script>

<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"

bordercolor="#000000" width="100%" id="AutoNumber1">
<tr>

<td align="center" width="25%">
  <form action=<%=PopFile%> method="POST">
  <font face="<%= strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strBaseFontColor

%>"><b>Foto album:</b>
  <select name="go" onChange="jumppage(this);" size=1>
  <%
  ShowSub = request("ShowSub")
  ShowPic = request("ShowPic")
  strPathInfo = Request.ServerVariables("PATH_INFO")
  strPhysicalPath = Server.MapPath(strPathInfo)

  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.GetFile(strPhysicalPath)
  Set objFolder = objFile.ParentFolder
  Set objFolderContents = objFolder.Files
  For each Folder in objFolder.SubFolders
      If Left(Folder.Name,1)<>"_" Then
          Response.write "<option "
          If ShowSub=Folder.Name Then
              Response.Write "selected "
          End if
          Response.Write"value='" & CurFile & "?ShowSub="
          Response.Write(Replace(Folder.Name, " ", "%20"))
          response.write "'>"
          Response.Write(Folder.Name & "</option>")
          If ShowSub <= " " Then
            ShowSub = Folder.Name
        End if
      End if
  Next
  Set objFSO = Nothing
  %>
  </select></h3>
  </form>
  </td>
</tr>
</table>


<%
If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:history.go(-1)'><img src='" & ShowPic & "'><BR><BR><font

face=""verdana"" size=""1""><b>G&aring; tilbage</b></a>"
Else
%>
  <table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse"

bordercolor="#000000" width="100%" id="AutoNumber1">
  <tr>
  <%
  strPhysicalPath = Server.MapPath(".\" & ShowSub)
  If ShowSub > " " then
    ShowSub = Replace(ShowSub, " ", "%20")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strPhysicalPath)
    Set objFolderContents = objFolder.Files



    'Get the number of pictures in the subdirectory
    intTotPics = 0
    For Each objFileItem in objFolderContents
        If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
            intTotPics = intTotPics + 1
        End if
    Next

    'Get the total number of pages in the subdirectory
    If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
        intTotPages = int(intTotPics/intPicsPerPage)
    Else
        intTotPages = int(intTotPics/intPicsPerPage)+1
    End If
    Redim strPicArray(2,intTotPics)

    'Store picture file names in an array
    x = 0
    For Each objFileItem in objFolderContents
        If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
            strPicArray(0,x) = objFileItem.Name
            strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1)
            x = x + 1
        End if
    Next

    'Determine if there are multiple pages and if so, display page numbers.
    If intTotPages > 1 Then
        Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial'

size='1'>Side:&nbsp;&nbsp;&nbsp;"
        For x = 1 to intTotPages
            If x = intPage Then
                Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial'

size='1'>&nbsp;&nbsp;&nbsp;&nbsp;"
            Else
                Response.Write "<a href='PhotoAlbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x &

"</a>&nbsp;&nbsp;&nbsp;&nbsp;"
            End If
        Next
        Response.Write "</font></td>"
        Response.Write "</tr><tr><td>&nbsp;</td></tr><tr>"
    End If


    For x = 0 to UBound(strPicArray,2)-1
    If CInt(strPicArray(1,x)) = intPage Then
    ShowPic = Replace(strPicArray(0,x), " ", "%20")
        Response.write "<td align='center' width='25%'><a href=""java script:openGalleryWindow('" &

PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
      Response.write "<br>"
      Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "' width=150 border='0'> ")
      Response.Write("<br><font color=""" & strBaseFontColor & """><b>" &

Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "</b></font>")
      Response.write "</a></td>" & vbcrlf

      PictureNo = PictureNo + 1
      If PictureNo=intPicsPerRow Then
          Response.write "</tr><tr>"
          PictureNo = 0
      End if
    End If
    Next

    Set objFSO = Nothing
  End if
  %>
  </tr>
  </table>
<%
End if
%>
</center>
</html>



------------------------------
ShowPicture.asp
------------------------------

<%
' ASP Picture Album

Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath

CurFile = "ShowPicture.asp"
%>

<html><head>
<title></title>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}
// -->
</script>
</head><body>

<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"

bordercolor="#111111" width="800" id="AutoNumber1">
<tr>
      <td align="center" width="75%">&nbsp; </td>
<td align="center" width="25%">
  <form action=<%=CurFile%> method="POST">
  <h3>Vælg Album :
  <select name="go" onChange="jumppage(this);" size=1>
  <%
  ShowSub = request("ShowSub")
  ShowPic = request("ShowPic")
  strPathInfo = Request.ServerVariables("PATH_INFO")
  strPhysicalPath = Server.MapPath(strPathInfo)

  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.GetFile(strPhysicalPath)
  Set objFolder = objFile.ParentFolder
  Set objFolderContents = objFolder.Files
  For each Folder in objFolder.SubFolders
      If Left(Folder.Name,1)<>"_" Then
          Response.write "<option "
          If ShowSub=Folder.Name Then
              Response.Write "selected "
          End if
          Response.Write"value='" & CurFile & "?ShowSub="
          Response.Write(Replace(Folder.Name, " ", "%20"))
          response.write "'>"
          Response.Write(Folder.Name & "</option>")
          If ShowSub <= " " Then
            ShowSub = Folder.Name
        End if
      End if
  Next
  Set objFSO = Nothing
  %>
  </select></h3>
  </form>
  </td>
</tr>
</table>
<hr>

<%
If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:history.go(-1)'><img src='" & ShowPic &

"'><BR><BR><B>Tilbage</B></a>"
Else
%>
  <table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse"

bordercolor="#111111" width="800" id="AutoNumber1">
  <tr>
  <%
  strPhysicalPath = Server.MapPath(".\" & ShowSub)
  If ShowSub > " " then
    ShowSub = Replace(ShowSub, " ", "%20")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strPhysicalPath)
    Set objFolderContents = objFolder.Files
    For Each objFileItem in objFolderContents
    If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
        ShowPic = Replace(objFileItem.Name, " ", "%20")
      'Response.write "<td align='center' width='25%'><a href=" & ShowSub & "\"
      Response.write "<td align='center' width='25%'><a href=" & CurFile & "?ShowPic=" & ShowSub  &

"\" & ShowPic
      'Response.Write(Replace(objFileItem.Name, " ", "%20"))
      Response.write ">"
      Response.Write("<img src='" & ShowSub & "\" & objFileItem.Name & "' width=200> ")
      Response.Write("<p align='center'><b>" & Mid(objFileItem.Name,1,Len(objFileItem.Name)-4) &

"</b>")
      Response.write "</a></td>"
      PictureNo = PictureNo + 1
      If PictureNo=4 Then
          Response.write "</tr><tr>"
          PictureNo = 0
      End if
    End if
    Next
    Set objFSO = Nothing
  End if
  %>
  </tr>
  </table>
<%
End if
%>
</center>
</html>
Avatar billede eagleeye Praktikant
07. november 2002 - 22:53 #1
Prøv med denne kode til PhotoAlbum.asp


<%

' PhotoAlbum

Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath


Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray()
intPicsPerRow  = 4
intPicsPerPage = 4

intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
    intPage = 1
End If

CurFile = "PhotoAlbum.asp"
PopFile = "ShowPicture.asp"
%>
<link rel="stylesheet" type="text/css" href="style.css">
<style>

a:link {
    color: #172166;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:visited {
    color: #172166;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:active {
    color: #FF0000;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

a:hover {
    color: #FF0000;
    text-decoration: underline;
    font-size: 12px;
    font-weight: bold;
}

</style>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}
// -->
</script>
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openGalleryWindow(url) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
    var xOffset = 100, yOffset = 100;

    popupWin =

window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
// done hiding -->
</script>

<center>

<%
ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)

if ShowSub <= " " then
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.GetFile(strPhysicalPath)
  Set objFolder = objFile.ParentFolder
  Set objFolderContents = objFolder.Files
  For each Folder in objFolder.SubFolders
    ShowSub = Folder.Name
    Exit For
  Next
  Set objFSO = Nothing
end if
%>

<%
If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:history.go(-1)'><img src='" & ShowPic & "'><BR><BR><font face=""verdana"" size=""1""><b>G&aring; tilbage</b></a>"
Else
%>
  <table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse" bordercolor="#000000" width="100%" id="AutoNumber2">
  <tr>
  <%
  strPhysicalPath = Server.MapPath("./" & ShowSub)
  If ShowSub > " " then
    ShowSub = Replace(ShowSub, " ", "%20")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strPhysicalPath)
    Set objFolderContents = objFolder.Files

    'Get the number of pictures in the subdirectory
    intTotPics = 0
    For Each objFileItem in objFolderContents
        If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
            intTotPics = intTotPics + 1
        End if
    Next

    'Get the total number of pages in the subdirectory
    If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
        intTotPages = int(intTotPics/intPicsPerPage)
    Else
        intTotPages = int(intTotPics/intPicsPerPage)+1
    End If
    Redim strPicArray(2,intTotPics)

    'Store picture file names in an array
    x = 0
    For Each objFileItem in objFolderContents
        If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
            strPicArray(0,x) = objFileItem.Name
            strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1)
            x = x + 1
        End if
    Next

    For x = 0 to UBound(strPicArray,2)-1
    If CInt(strPicArray(1,x)) = intPage Then
      ShowPic = Replace(strPicArray(0,x), " ", "%20")
      Response.write "<td align='center' width='25%'><a href=""java script:openGalleryWindow('" & PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
      Response.write "<br>"
      Response.Write("<img src='" & ShowSub & "/" & strPicArray(0,x) & "' width=150 border='0'> ")
      'Response.Write("<br><font color=""" & strBaseFontColor & """><b>" & Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "</b></font>")
      Response.write "</a></td>" & vbcrlf

      PictureNo = PictureNo + 1
      If PictureNo=intPicsPerRow Then
          Response.write "</tr><tr>"
          PictureNo = 0
      End if
    End If
    Next


    'Determine if there are multiple pages and if so, display page numbers.
    If intTotPages > 1 Then
        Response.Write "<td colspan='" & intPicsPerRow & "' align='center'><font face='Verdana,Arial' size='1'>Side:&nbsp;&nbsp;&nbsp;"
        For x = 1 to intTotPages
            If x = intPage Then
                Response.Write "</font><font face='Arial' size='2'>" & x & "</font><font face='Arial' size='1'>&nbsp;&nbsp;&nbsp;&nbsp;"
            Else
                Response.Write "<a href='PhotoAlbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "'>" & x & "</a>&nbsp;&nbsp;&nbsp;&nbsp;"
            End If
        Next
        Response.Write "</font></td>"
        Response.Write "</tr><tr><td>&nbsp;</td></tr><tr>"
    End If

    Set objFSO = Nothing
  End if
  %>
  </tr>
  </table>
<%
End if
%>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="100%" id="AutoNumber1">
<tr>

<td align="center" width="25%">
  <form action=<%=PopFile%> method="POST" id=form1 name=form1>
  <font face="<%= strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strBaseFontColor %>"><b>Foto album:</b>
  <select name="go" onChange="jumppage(this);" size=1>
  <%

  strPathInfo = Request.ServerVariables("PATH_INFO")
  strPhysicalPath = Server.MapPath(strPathInfo)

  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.GetFile(strPhysicalPath)
  Set objFolder = objFile.ParentFolder
  Set objFolderContents = objFolder.Files
  For each Folder in objFolder.SubFolders
      If Left(Folder.Name,1)<>"_" Then
          Response.write "<option "
          If ShowSub=Folder.Name Then
              Response.Write "selected "
          End if
          Response.Write"value='" & CurFile & "?ShowSub="
          Response.Write(Replace(Folder.Name, " ", "%20"))
          response.write "'>"
          Response.Write(Folder.Name & "</option>")
'          If ShowSub <= " " Then
'            ShowSub = Folder.Name
'        End if
      End if
  Next
  Set objFSO = Nothing
  %>
  </select></h3>
  </form>
  </td>
</tr>
</table>

</center>
</html>
Avatar billede eagleeye Praktikant
07. november 2002 - 22:56 #2
Dette er et forsøg på ShowPicture.asp :



<%
' ASP Picture Album

Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath

CurFile = "ShowPicture.asp"
%>

<html><head>
<title></title>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}
// -->
</script>
</head><body>

<center>
<%
'ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
'strPathInfo = Request.ServerVariables("PATH_INFO")
'strPhysicalPath = Server.MapPath(strPathInfo)

'Set objFSO = CreateObject("Scripting.FileSystemObject")


If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "'></a>"
Else
  Response.Write "Error...No picture file"
End if
%>
</center>
</html>
Avatar billede gruppe422 Nybegynder
07. november 2002 - 23:07 #3
1000 Tak, er det muligt at du kan fjerne den ramme der er omkring billedet i popup vinduet. Samt at få popup vinduet til at stå centreret på skærmen?
Avatar billede eagleeye Praktikant
07. november 2002 - 23:11 #4
I ShowPicture.asp rette du denne linie:

Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "'></a>"

Til dette så skulle rammen forsvinde..:
Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0></a>"
Avatar billede eagleeye Praktikant
07. november 2002 - 23:13 #5
Det med center på skærmen skulle gerne blive udregnet i denne function i PhotoAlbum.asp:

Men jeg kan godt se et er ikke helt center på skærmen det bliver åbnet..



function openGalleryWindow(url) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
    var xOffset = 100, yOffset = 100;

    popupWin =

window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+

',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
Avatar billede eagleeye Praktikant
07. november 2002 - 23:16 #6
Prøv at rette function til:


function openGalleryWindow(url) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;
//    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
//    var xOffset = 100, yOffset = 100;

    var xOffset = (xMax - 700)/2, yOffset = (yMax - 535)/2;

    popupWin =

window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
Avatar billede gruppe422 Nybegynder
07. november 2002 - 23:24 #7
Perfekt!, men jeg har lige et lille spørgsmål til!. Kan det lade sig gøre, at få popup vinduet til at tilpasse sig billedet, så der ikke er det store tomrum omkring det.....
Avatar billede gruppe422 Nybegynder
07. november 2002 - 23:31 #8
for pt. passer det jo ikke til alle billeder. Hvis der nu kommer et lille billed, er der jo alt for meget spildplads. Og hvis der kommer et stort billed, kan man ikke se det hele...
Avatar billede eagleeye Praktikant
07. november 2002 - 23:35 #9
Enten skal man lave det så ASP koden tjekke på størrelsen og så bruger man det til at vise billet.. Eller så skal man lave et script som kan tilpasse vinduet efter billet et loaded.
Avatar billede eagleeye Praktikant
07. november 2002 - 23:37 #10
er lige ved at prøve noget :)
Avatar billede eagleeye Praktikant
07. november 2002 - 23:40 #11
Prøv i ShowPicture.asp atrette du denne linie:

Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0></a>"


Til dette så resizer den men så passer center ikke længere....:

Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0 onload=""window.resizeTo(this.width,this.height);""></a>"
Avatar billede gruppe422 Nybegynder
07. november 2002 - 23:50 #12
det er som om den skøre en centimeter af kanten af billedet
Avatar billede eagleeye Praktikant
07. november 2002 - 23:52 #13
Ja det gør den også det må være noget med at man ændre på yder rammen og ikke det inden for....


Prøv at bruge denne ShowPicture.asp  fil...:


<%
' ASP Picture Album

Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath

CurFile = "ShowPicture.asp"
%>

<html><head>
<title></title>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}

function afterLoad(iWidth,iHeight) {
    iWidth += 25;
    iHeight += 50;
   
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;

    var xOffset = (xMax - iWidth)/2, yOffset = (yMax - iHeight)/2;
   
    window.moveTo(xOffset,yOffset);
    window.resizeTo(iWidth,iHeight);
}
// -->
</script>
</head><body>

<center>
<%
'ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
'strPathInfo = Request.ServerVariables("PATH_INFO")
'strPhysicalPath = Server.MapPath(strPathInfo)

'Set objFSO = CreateObject("Scripting.FileSystemObject")


If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0 onload=""afterLoad(this.width,this.height);""></a>"
Else
  Response.Write "Error...No picture file"
End if
%>
</center>
</html>
Avatar billede eagleeye Praktikant
08. november 2002 - 00:01 #14
Jeg er ikke en haj til Javascritp/HTMl men fandt en side som skrev man skal havde <div style="position:absolute; left:0px; top:0px"> ind omkring billedet for det ikke står ½-1 cm inden på siden så her er en ny udgave af filen

ShowPicture.asp :


<%
' ASP Picture Album

Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath

CurFile = "ShowPicture.asp"
%>

<html><head>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}

function afterLoad(iWidth,iHeight) {
 
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;

    var xOffset = (xMax - iWidth)/2, yOffset = (yMax - iHeight)/2;
   
    window.moveTo(xOffset,yOffset);
    window.resizeTo(iWidth,iHeight);
}
// -->
</script>
</head><body>
<div style="position:absolute; left:0px; top:0px">
<!--<center>-->
<%
'ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
'strPathInfo = Request.ServerVariables("PATH_INFO")
'strPhysicalPath = Server.MapPath(strPathInfo)

'Set objFSO = CreateObject("Scripting.FileSystemObject")


If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0 onload=""afterLoad(this.width,this.height);""></a>"
Else
  Response.Write "Error...No picture file"
End if
%>
<!--</center>-->
</div>
</body>
</html>
Avatar billede eagleeye Praktikant
08. november 2002 - 00:07 #15
Men det ser nu stadig ud som om der mangler lidt i bunden....Så prøv denne også med ldit snyd i scritpet som resizer...

ShowPicture.asp


<%
' ASP Picture Album

Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath

CurFile = "ShowPicture.asp"
%>

<html><head>
<script language="JavaScript">
<!--
function jumppage(sel)
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}

function afterLoad(iWidth,iHeight) {
    iWidth += 12;
    iHeight += 30;
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 800, yMax=600;

    var xOffset = (xMax - iWidth)/2, yOffset = (yMax - iHeight)/2;
   
    window.moveTo(xOffset,yOffset);
    window.resizeTo(iWidth,iHeight);
}
// -->
</script>
</head><body>
<div style="position:absolute; left:0px; top:0px">
<!--<center>-->
<%
'ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
'strPathInfo = Request.ServerVariables("PATH_INFO")
'strPhysicalPath = Server.MapPath(strPathInfo)

'Set objFSO = CreateObject("Scripting.FileSystemObject")


If ShowPic > " " then
  ShowPic = Replace(ShowPic, " ", "%20")
  Response.Write "<a href='java script:window.close()'><img src='" & ShowPic & "' border=0 onload=""afterLoad(this.width,this.height);""></a>"
Else
  Response.Write "Error...No picture file"
End if
%>
<!--</center>-->
</div>
</body>
</html>


Jeg er nød til at smutte for i aften, alternativt kan du sprøge om hjælpt til Javascriptet i javascritp kategorien..
Avatar billede gruppe422 Nybegynder
08. november 2002 - 00:09 #16
øv!, den gør det samme endnu!

Men du skal have 1000 Tak for hjælpen. Så her har du dine point.....
Avatar billede gruppe422 Nybegynder
08. november 2002 - 00:11 #17
Nej, jeg tror sku det virker nu.... Tak endnu engang.......
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester