I use the following code in asp to change the image size of the images that draw to the page.
It works fine!
However, is there a more effecient way or more technically correct way to do this using javascript or Jason or whatever?
I want to fine tune and learn other ways and would appreciate your thoughts and other ways to do something that works.
Thank you.
I use these dropdowns to select the image size. It’s then stored in the database.
<tr>
<td align="center" bgcolor="#c4d7dd" height="23">Photo Image Size<br />
<select name="PhotoSize">
<option selected value="<%=objRS("PhotoSize")%>"><%=objrs("PhotoSize")%></option>
<option value="Small">Small</option>
<option value="Medium Small">Medium Small</option>
<option value="Medium">Medium</option>
<option value="Medium Large">Medium Large</option>
<option value="Large">Large</option>
</select>
</td></tr><tr>
<td align="center">Logo Image Size<br />
<select name="LogoSize">
<option selected value="<%=objRS("LogoSize")%>"><%=objrs("LogoSize")%></option>
<option value="Small">Small</option>
<option value="Medium Small">Medium Small</option>
<option value="Medium">Medium</option>
<option value="Medium Large">Medium Large</option>
<option value="Large">Large</option>
</select>
</td>
</tr>
<tr>
I then use this asp code to read the database for the size.
<%if rs("photosize") = "Small" then%>
<style>
img.resize{
max-height:100px;
max-width:100px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("PhotoSize") = "Medium Small" then%>
<style>
img.resize{
max-height:150px;
max-width:150px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("photosize") = "Medium" then%>
<style>
img.resize{
max-height:250px;
max-width:250px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("photosize") = "Medium Large" then%>
<style>
img.resize{
max-height:325px;
max-width:325px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("photosize") = "Large" then%>
<style>
img.resize{
max-height:450px;
max-width:450px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("Logosize") = "Small" then%>
<style>
img.resize2{
max-height:100px;
max-width:100px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if objrs("Logosize") = "Medium Small" then%>
<style>
img.resize2{
max-height:150px;
max-width:150px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("Logosize") = "Medium" then%>
<style>
img.resize2{
max-height:250px;
max-width:250px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("Logosize") = "Medium Large" then%>
<style>
img.resize2{
max-height:325px;
max-width:325px;
height:auto;
width:auto;
}
</style>
<%end if %>
<%if rs("Logosize") = "Large" then%>
<style>
img.resize2{
max-height:450px;
max-width:450px;
height:auto;
width:auto;
}
</style>
<%end if %>
And then in my html code I use class resize and resize2 to draw the image to the page.
<img class=""resize"" src = "database location"
<img class=""resize2"" src = "database location"