Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting image properties
Message
 
À
17/12/2003 14:17:48
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00860039
Message ID:
00860257
Vues:
14
Hi Larry,

Here is some sample Javascript that resizes the image when the browser is resized:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>Image Gallery</title>
  <meta http-equiv="Pragma" content="no-cache">
  <script type="text/javascript"
language="JavaScript"><!--
   // Resize the picture based on the size of the
browser
   function resizePic() {
    var browser_width, browser_height;
    var dest_width, dest_height;
    var proportion;
    browser_width =
document.body.offsetWidth-20;
    browser_height =
document.body.offsetHeight-20;
    if
((document.getElementById('MyImage').width/browser_width) >
(document.getElementById('MyImage').height/browser_height)) {
     proportion =
document.getElementById('MyImage').width/browser_width;
    } else {
     proportion =
document.getElementById('MyImage').height/browser_height;
    }
    dest_width =
document.getElementById('MyImage').width / proportion;
    dest_height =
document.getElementById('MyImage').height / proportion;

document.getElementById('MyImage').width = dest_width;

document.getElementById('MyImage').height = dest_height;
   }
  //--></script>
  <style type="text/css">
   BODY { MARGIN: 0px; }
  </style>
 </head>
<body onload="javascript:resizePic();"
onresize="javascript:resizePic();">
<img src="/edtest/DSC00461.jpg" id="MyImage" alt="My Image">
<br><br><a href="javascript:history.back();">Go Back</a></center><br>
<body>
</html>
>I am trying to create a simple web form using VS.NET v1.1.
>
>Is there a way to make an image appear as a "page header"? If so, how? I want the image to show at the top of the page and auto size from left to right visible margins retaining its proportional height.
>
>TIA,
>Larry Long
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform