I take advantage of the next code in asp to vary the picture dimension of the pictures that draw to the web page.
It really works positive!
Nevertheless, is there a extra effecient means or extra technically appropriate means to do that utilizing javascript or Jason or no matter?
I need to positive tune and study different methods and would respect your ideas and different methods to do one thing that works.
Thanks.
I take advantage of these dropdowns to pick out the picture dimension. It’s then saved within the database.
<tr>
<td align="heart" bgcolor="#c4d7dd" top="23">Photograph Picture Dimension<br />
<choose identify="PhotoSize">
<possibility chosen worth="<%=objRS("PhotoSize")%>"><%=objrs("PhotoSize")%></possibility>
<possibility worth="Small">Small</possibility>
<possibility worth="Medium Small">Medium Small</possibility>
<possibility worth="Medium">Medium</possibility>
<possibility worth="Medium Giant">Medium Giant</possibility>
<possibility worth="Giant">Giant</possibility>
</choose>
</td></tr><tr>
<td align="heart">Emblem Picture Dimension<br />
<choose identify="LogoSize">
<possibility chosen worth="<%=objRS("LogoSize")%>"><%=objrs("LogoSize")%></possibility>
<possibility worth="Small">Small</possibility>
<possibility worth="Medium Small">Medium Small</possibility>
<possibility worth="Medium">Medium</possibility>
<possibility worth="Medium Giant">Medium Giant</possibility>
<possibility worth="Giant">Giant</possibility>
</choose>
</td>
</tr>
<tr>
I then use this asp code to learn the database for the dimensions.
<%if rs("photosize") = "Small" then%>
<fashion>
img.resize
max-height:100px;
max-width:100px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("PhotoSize") = "Medium Small" then%>
<fashion>
img.resize
max-height:150px;
max-width:150px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("photosize") = "Medium" then%>
<fashion>
img.resize
max-height:250px;
max-width:250px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("photosize") = "Medium Giant" then%>
<fashion>
img.resize
max-height:325px;
max-width:325px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("photosize") = "Giant" then%>
<fashion>
img.resize
max-height:450px;
max-width:450px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("Logosize") = "Small" then%>
<fashion>
img.resize2
max-height:100px;
max-width:100px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if objrs("Logosize") = "Medium Small" then%>
<fashion>
img.resize2
max-height:150px;
max-width:150px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("Logosize") = "Medium" then%>
<fashion>
img.resize2
max-height:250px;
max-width:250px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("Logosize") = "Medium Giant" then%>
<fashion>
img.resize2
max-height:325px;
max-width:325px;
top:auto;
width:auto;
</fashion>
<%finish if %>
<%if rs("Logosize") = "Giant" then%>
<fashion>
img.resize2
max-height:450px;
max-width:450px;
top:auto;
width:auto;
</fashion>
<%finish if %>
After which in my html code I take advantage of class resize and resize2 to attract the picture to the web page.
<img class=""resize"" src = "https://information.google.com/__i/rss/rd/articles/database location"
<img class=""resize2"" src = "https://information.google.com/__i/rss/rd/articles/database location"
Sure, discover how all of your CSS lessons are just about the identical apart from the dimensions. So all you actually have to be doing is deciding on the dimensions possibility and monitoring which dimension that maps to and use it as soon as as an alternative the fashion. I like to recommend utilizing a dictionary to find out the brand dimension and as soon as that’s decided, you may then use it within the fashion.
<%
Dim imgSizes As New Dictionary(Of String, String)
imgSizes.add('Giant', '450px')
imgSizes.add('Medium Giant', '325px')
imgSizes.add('Medium', '250px')
Dim sizeSelected as String = imgSizes(rs("Logosize"))
%>
Now sizeSelected must be your dimension string, use it as soon as within the fashion…
<fashion>
img.resize
max-height: <%= sizeSelected %>;
max-width: <%= sizeSelected %>;
top:auto;
width:auto;
</fashion>
I haven’t written ASP in ages, however hopefully you get the idea right here.
P.S. You didn’t say if it was traditional ASP or ASP.NET, so I wen’t ASP.NET fashion right here
Sorry, I didn’t. It’s traditional so I’m not acquainted with Dictionary.
I’ll take a look at your strategies, however I wasn’t positive if there’s a extra environment friendly means of utilizing Jason that doing it in ASP Basic.