Image Proportion Script Florida

Enter height and width of an image to resize. Then enter a new height; the script figures the new width, keeping the same proportions the image original had.

Local Companies

Keylogger
001-9900000000
Address1 street
Province, FL
Office Management Solutions Inc
813-963-5582
5802 Taywood DR
Tampa, FL
Summit Software Design
727-823-1000
100 2nd Ave S
St. Petersburg, FL
Riptide Software
407-384-8818
3452 Lake Lynda Dr
Orlando, FL
Gbr Corp
(305) 621-9871
14411 Commerce Way
Hialeah, FL
Keylogger
001-9900000000
Address1 street
Province, FL
MFG/EDP, Inc.
(305) 292-2660
1224 South St.
Key West, FL
Nextlevel Information Solutions
727-821-7444
700 Central Ave
St. Petersburg, FL
Progressive System Solutions Inc
407-523-7676
4019 Clarcona Ocoee RD
Orlando, FL
Acusoft
407-658-9888
11869 High Tech Ave
Orlando, FL

provided by: 
Originally published at Internet.com


Tip to my Lou...

I received this "Proportional" script from Ann Evans. It's a great idea. You enter the height and width of an image you want to resize. Then, by entering a new height, the script figures the new width, keeping the same proportions the image originally had.

I really liked the script, but thought it asked too much of the user. I knew you could grab the image's height and width straight from the image. Then, after setting the new height and width, it seemed logical to show the image in its new dimensions.

So, using Ann's original calculations and table structure, I rewrote and added on until I got this. Try it out.

When the prompt appears, put in "angel.jpg"
(without the quotes)!

See it in Action

-----------------------------------

Here's the Code

(It's big. Get it all.)

Did you like the purple background? I thought it was a bit easier on the eyes than bright white.

The script uses a series of steps to complete the effect. We'll start with the first thing you see on the page, the prompt. The blip of prompt code asks for the path to the image. Yes, I know it's a little wordy and long to read.

Once the prompt has the path and/or name of the image, then it uses that to create an image flag that posts the image to the page. Let's look at it. Please understand that I have greatly reduced the amount of text in the prompt box for this example.

As I pointed out in the last series of Script Tips, one of the hardest things to do when writing a script is to guess at all the possibilities that could occur when someone uses your script. When this prompt popped up, I saw four events that could happen. Here are those events and my solutions:

* The user enters a correct image name and/or path
Solution: the image is posted

* The user clicks OK, making the changes
Solution: Alert box telling user to put in image name

* The user clicks CANCEL
Solution: Alert box asking for image name

* The user enters incorrect information
Solution: I can't predict incorrect info, so that results in a broken image, which gives a 40X40 height and width

I wrote the prompt above to cover each of those concerns. If you'd like to go back to the example and try each event, click here. Otherwise, let's take it in order.

var path = prompt("Text on the gray","Text in the box") This is the basic format of a prompt. Again, I have greatly reduced the text used in the original, but you'll get the idea. Whatever the user writes in the box is assigned the variable name "path."

if(path == "Text in the box") { alert('Come on, put in an image name') javasscript:location.reload() } The first If statement is used if the user simply presses OK without changing the information in the box.

If the "path" equals "Text in the box" (note the double quotes so that 'Text in the Box' is seen as a text string rather than code), then pop up an alert that reads "Come on, put in an image name." Once the user clicks OK on the alert box, javascript:location.reload() reloads the page and the prompt pops up again.

Two things: There are curly brackets around the alert and the reload. That's important so that the script understands to do both if the statement is true. Also, note that the text string is the same as what is in the text box on the prompt. Make sure those two are the same when you use the script or no dice.

if(path == null) { alert('Do not click Cancel') javascript:location.reload() } Here's the second If statement. The script goes to this one if the first isn't found to be true. This is triggered if the prompt data is null. That means the user simply clicked CANCEL. Notice "null" is not in quotes. It is not a text string, but rather a command.

The same basic format is used if this If statement is true. An alert pops up, the page is reloaded, and the prompt pops up again.

else {document.write("");} If both of the If statements are false, which is what you're hoping for, then a document.write statement is used to create a basic image flag, posting the picture the user has entered.

See the NAME=thepic in the flag? That will become important in the next section of this Script Tip.

Next Time: Grab and Display the Dimensions

Author: Joe Burns

Read article at Internet.com site

Featured Local Company

Keylogger

001-9900000000
Address1 street
Province, FL

Regional Articles
- Image Proportion Script Altamonte Springs FL
- Image Proportion Script Apopka FL
- Image Proportion Script Arcadia FL
- Image Proportion Script Atlantic Beach FL
- Image Proportion Script Auburndale FL
- Image Proportion Script Avon Park FL
- Image Proportion Script Bartow FL
- Image Proportion Script Belle Glade FL
- Image Proportion Script Boca Raton FL
- Image Proportion Script Bonita Springs FL
- Image Proportion Script Boynton Beach FL
- Image Proportion Script Bradenton FL
- Image Proportion Script Brandon FL
- Image Proportion Script Brooksville FL
- Image Proportion Script Cantonment FL
- Image Proportion Script Cape Coral FL
- Image Proportion Script Casselberry FL
- Image Proportion Script Chipley FL
- Image Proportion Script Clearwater FL
- Image Proportion Script Clermont FL
- Image Proportion Script Clewiston FL
- Image Proportion Script Cocoa Beach FL
- Image Proportion Script Cocoa FL
- Image Proportion Script Crawfordville FL
- Image Proportion Script Crestview FL
- Image Proportion Script Crystal River FL
- Image Proportion Script Dade City FL
- Image Proportion Script Dania FL
- Image Proportion Script Daytona Beach FL
- Image Proportion Script Debary FL
- Image Proportion Script Deerfield Beach FL
- Image Proportion Script Defuniak Springs FL
- Image Proportion Script Deland FL
- Image Proportion Script Delray Beach FL
- Image Proportion Script Deltona FL
- Image Proportion Script Destin FL
- Image Proportion Script Dunedin FL
- Image Proportion Script Dunnellon FL
- Image Proportion Script Englewood FL
- Image Proportion Script Eustis FL
- Image Proportion Script Fernandina Beach FL
- Image Proportion Script Fort Lauderdale FL
- Image Proportion Script Fort Myers FL
- Image Proportion Script Fort Pierce FL
- Image Proportion Script Fort Walton Beach FL
- Image Proportion Script Gainesville FL
- Image Proportion Script Green Cove Springs FL
- Image Proportion Script Gulf Breeze FL
- Image Proportion Script Haines City FL
- Image Proportion Script Hallandale FL
- Image Proportion Script Hialeah FL
- Image Proportion Script Hobe Sound FL
- Image Proportion Script Holiday FL
- Image Proportion Script Hollywood FL
- Image Proportion Script Homestead FL
- Image Proportion Script Homosassa FL
- Image Proportion Script Hudson FL
- Image Proportion Script Immokalee FL
- Image Proportion Script Inverness FL
- Image Proportion Script Jacksonville Beach FL
- Image Proportion Script Jacksonville FL
- Image Proportion Script Jensen Beach FL
- Image Proportion Script Jupiter FL
- Image Proportion Script Key West FL
- Image Proportion Script Kissimmee FL
- Image Proportion Script Labelle FL
- Image Proportion Script Lady Lake FL
- Image Proportion Script Lake City FL
- Image Proportion Script Lake Mary FL
- Image Proportion Script Lake Placid FL
- Image Proportion Script Lake Wales FL
- Image Proportion Script Lake Worth FL
- Image Proportion Script Lakeland FL
- Image Proportion Script Land O Lakes FL
- Image Proportion Script Largo FL
- Image Proportion Script Leesburg FL
- Image Proportion Script Lehigh Acres FL
- Image Proportion Script Live Oak FL
- Image Proportion Script Longwood FL
- Image Proportion Script Loxahatchee FL
- Image Proportion Script Lutz FL
- Image Proportion Script Lynn Haven FL
- Image Proportion Script Marco Island FL
- Image Proportion Script Marianna FL
- Image Proportion Script Melbourne FL
- Image Proportion Script Merritt Island FL
- Image Proportion Script Miami Beach FL
- Image Proportion Script Miami FL
- Image Proportion Script Miami Lakes FL
- Image Proportion Script Middleburg FL
- Image Proportion Script Milton FL
- Image Proportion Script Miramar FL
- Image Proportion Script Mount Dora FL
- Image Proportion Script Mulberry FL
- Image Proportion Script Naples FL
- Image Proportion Script Navarre FL
- Image Proportion Script New Port Richey FL
- Image Proportion Script New Smyrna Beach FL
- Image Proportion Script Niceville FL
- Image Proportion Script Nokomis FL
- Image Proportion Script North Fort Myers FL
- Image Proportion Script North Miami Beach FL
- Image Proportion Script North Palm Beach FL
- Image Proportion Script North Port FL
- Image Proportion Script Ocala FL
- Image Proportion Script Ocoee FL
- Image Proportion Script Okeechobee FL
- Image Proportion Script Oldsmar FL
- Image Proportion Script Opa Locka FL
- Image Proportion Script Orange City FL
- Image Proportion Script Orange Park FL
- Image Proportion Script Orlando FL
- Image Proportion Script Ormond Beach FL
- Image Proportion Script Oviedo FL
- Image Proportion Script Palatka FL
- Image Proportion Script Palm Bay FL
- Image Proportion Script Palm Beach FL
- Image Proportion Script Palm Beach Gardens FL
- Image Proportion Script Palm City FL
- Image Proportion Script Palm Coast FL
- Image Proportion Script Palm Harbor FL
- Image Proportion Script Palmetto FL
- Image Proportion Script Panama City Beach FL
- Image Proportion Script Panama City FL
- Image Proportion Script Pembroke Pines FL
- Image Proportion Script Pensacola FL
- Image Proportion Script Pinellas Park FL
- Image Proportion Script Plant City FL
- Image Proportion Script Pompano Beach FL
- Image Proportion Script Ponte Vedra Beach FL
- Image Proportion Script Port Charlotte FL
- Image Proportion Script Port Orange FL
- Image Proportion Script Port Richey FL
- Image Proportion Script Port Saint Lucie FL
- Image Proportion Script Punta Gorda FL
- Image Proportion Script Riverview FL
- Image Proportion Script Rockledge FL
- Image Proportion Script Safety Harbor FL
- Image Proportion Script Saint Augustine FL
- Image Proportion Script Saint Cloud FL
- Image Proportion Script Saint Petersburg FL
- Image Proportion Script Sanford FL
- Image Proportion Script Sarasota FL
- Image Proportion Script Satellite Beach FL
- Image Proportion Script Sebastian FL
- Image Proportion Script Sebring FL
- Image Proportion Script Seffner FL
- Image Proportion Script Seminole FL
- Image Proportion Script Spring Hill FL
- Image Proportion Script Starke FL
- Image Proportion Script Stuart FL
- Image Proportion Script Summerfield FL
- Image Proportion Script Sun City Center FL
- Image Proportion Script Tallahassee FL
- Image Proportion Script Tampa FL
- Image Proportion Script Tarpon Springs FL
- Image Proportion Script Titusville FL
- Image Proportion Script Valrico FL
- Image Proportion Script Venice FL
- Image Proportion Script Vero Beach FL
- Image Proportion Script Wauchula FL
- Image Proportion Script Wesley Chapel FL
- Image Proportion Script West Palm Beach FL
- Image Proportion Script Winter Garden FL
- Image Proportion Script Winter Haven FL
- Image Proportion Script Winter Park FL
- Image Proportion Script Winter Springs FL
- Image Proportion Script Zephyrhills FL
Related Local Events
Wednesday Evening Referral Group
Dates: 5/5/2010 - 5/7/2010
Location: WineStyles
Coral Springs, FL
View Details

Wake Up Coral Springs Breakfast!!
Dates: 6/15/2010 - 6/15/2010
Location: Marriott Heron Bay
Coral Springs, FL
View Details

Afternoon Chamber Referral Group
Dates: 7/1/2010 - 7/1/2010
Location: The Coral Springs Chamber Office
Coral Springs, FL
View Details

Morning Chamber Referral Group Meeting
Dates: 7/22/2010 - 7/22/2010
Location: La Quinta Hotel
Coral Springs, FL
View Details

Business Development Committee Meeting TIME CHANGED
Dates: 7/27/2010 - 7/27/2010
Location: St. Lucie County Chamber of Commerce
Port St. Lucie, FL
View Details

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML