Sunday, April 2, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

Resizing images using database and dropdowns – JavaScript – SitePoint Forums

learningcode_x1mckf by learningcode_x1mckf
November 28, 2022
in JavaScript
0
Time limit for notify – JavaScript – SitePoint Forums
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


You might also like

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

Understanding the Power of Proxy in JavaScript – hackernoon.com

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

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"


Martyr2



November 27, 2022, 11:07pm
#2

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. :smiley:

P.S. You didn’t say if it was traditional ASP or ASP.NET, so I wen’t ASP.NET fashion right here

Martyr2:

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.



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

4 Packages for Working With Date and Time in JavaScript  MUO - MakeUseOf Source link

Read more

Understanding the Power of Proxy in JavaScript – hackernoon.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Understanding the Power of Proxy in JavaScript  hackernoon.com Source link

Read more

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JavaScript vs. TypeScript: What's the difference?  TheServerSide.com Source link

Read more

JetBrains updates IDEs for Java, JavaScript, Ruby – InfoWorld

by learningcode_x1mckf
March 31, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JetBrains updates IDEs for Java, JavaScript, Ruby  InfoWorld Source link

Read more

Virtru Announces First Ever FIPS 140-2 Validated JavaScript … – GlobeNewswire

by learningcode_x1mckf
March 30, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Virtru Announces First Ever FIPS 140-2 Validated JavaScript ...  GlobeNewswire Source link

Read more
Next Post
Chamber Member of the Week: Kahawa Java

Chamber Member of the Week: Kahawa Java

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

NSA Indirectly Implies that C And C++ Are Not Safe for Developers … – Analytics Insight

February 18, 2023
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

How to apply the single responsibility principle in Java – TheServerSide.com

March 30, 2023
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

C++ Zooms Past Java in Programming Language Popularity Contest – Slashdot

February 11, 2023

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • So why did they decide to call it Java? – InfoWorld
  • Senior Java Developer – IT-Online
  • 4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?