".. and I say to myself,
what a wonderful world.."
wearing green today.. to reduce the heat in the air haha.. there has been something wrong with this room's aircon for days..
and as i wandered around the office, stopping here n there (gossiping in finance dept, red.), i can really feel the difference.. *sigh* .. n now, back in this room (graphic dept, red.), it somehow just feels even hotter!!!
A story about ASP :D
I'm making a gallery page n found problem trying to display the pictures.. some of the pics' dimensions r larger than the frame's n it got ruined (the frame just went here n there, very messy!!!)
#1:
<img src="ehm.jpg" width="380">
using "width" with the "img" properties didnt do any good.. as u might know, it resizes all the pics to that specified width, including the small pics, showing every bit of their pixels..
#2:
<img src="ehm.jpg" style="max-width:380">
Sure, that works with Mozilla n perhaps any other browser, but not IE.. Oh i supposed it should work with Opera too..
the small pics r shown in their real dimensions, while the big ones r shown in the specified width (380).. with Opera too, but the frame was still a mess, as if the pic hasnt been resized at all..!!
#3:
.previmg {
max-width:380px;
width: expression(this.width > 380 ? 380: true);
}
browsed the i-net n found above code.. thanx to phydeaux3 .. just add that css code and change the img tag to:
<img src="ehm.jpg" class="previmg">
n voila! the IE problem's solved..
unfortunately, it's still the same problem with Opera..
by that time, my senior told me that's a common problem in design, just ignore it n stick to the most-use browser (IE)
#4:
<%
imgpath = Server.MapPath("./ehm.jpg")
Set fs= CreateObject("Scripting.FileSystemObject")
If fs.fileExists(imgpath) Then
set myImg = loadpicture(imgpath)
imgwidth = myImg.width/26.4583
If imgwidth <= 380 Then
imgwidth = imgwidth
Else
imgwidth = 380
End If
End If
Response.Write("<img src=""ehm.jpg"" width=""" & imgwidth & """>")
%>
Finally!! found this code.. thanx to Frank and all problems r solved!! hahahaha.. so happyyyyyyyyyy... (for now) :D
who says that "4" is a bad number??
perhaps there's a simplier way??