| View previous topic :: View next topic |
| Author |
Message |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Feb 18, 2009 7:44 am Post subject: |
|
|
I'm trying create a drop down thumbnail of each image when select each value.
the script below is to pull the images from the project folder:
var path = “http://www.four51.com/Themes/Custom/de891832-01b5-4c5d-84da-b4f85e394864/demo/jerseys/”;
my images are not showing up. what is the path after the shared folder ID# highlighted in red above?
view link below.
http://www.insightsfour51.com/?author=3
Any help would be great. Thank You.
Thank You. |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Mon Apr 13, 2009 6:45 am Post subject: |
|
|
After few trials and errors I was able to get the thumbnail images to preview when selecting from drop down options.
My other questions is I added two drop down options and would like both options to view thumbnails.
When i added the second drop down options my first options thumbnail images does not show but my second drop down options thumbnail images does show.
below is the advanced scripting:
DROP DOWN OPTION #1:
var preview = get('preview');var image_choice = spec['ImageChoice'];var path = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";var images = { "AAO Member": "Ortho_AAO_MEMBER.jpg", "AAO Members": "Ortho_AAO_MEMBERS.jpg", "ABO Diplomate": "Ortho_DIP.jpg", "ABO Diplomates": "Ortho_DIPS.jpg", "No Logo": "NoLogo.jpg"}function Display() { preview.imgSrc(path + images[image_choice.selectedText()]);}image_choice.onchange = Display; image_choice.removeOption(0);spec ['Images'].hide();Display();
DROP DOWN OPTION #2:
var preview = get('preview1');var image_choice = spec['ImageChoice1'];var path = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";var images = { "NO BACKER": "NO-BACKER.jpg", "MC/VISA": "MC-VISA1.jpg", "MC/VISA/DIS": "MC-VISA-DIS1.jpg", "MC/VISA/AMX": "MC-VISA-AMX.jpg", "MC/VISA/DIS/AMX": "MC-VISA-DIS-AMX.jpg"}function Display() { preview.imgSrc(path + images[image_choice.selectedText()]);}image_choice.onchange = Display; image_choice.removeOption(0);spec ['Images1'].hide();Display(); |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Tue Apr 14, 2009 4:46 am Post subject: |
|
|
quote: Originally posted by mvang
After few trials and errors I was able to get the thumbnail images to preview when selecting from drop down options.
My other questions is I added two drop down options and would like both options to view thumbnails.
When i added the second drop down options my first options thumbnail images does not show but my second drop down options thumbnail images does show.
below is the advanced scripting:
DROP DOWN OPTION #1:
var preview = get('preview');var image_choice = spec['ImageChoice'];var path = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";var images = { "AAO Member": "Ortho_AAO_MEMBER.jpg", "AAO Members": "Ortho_AAO_MEMBERS.jpg", "ABO Diplomate": "Ortho_DIP.jpg", "ABO Diplomates": "Ortho_DIPS.jpg", "No Logo": "NoLogo.jpg"}function Display() { preview.imgSrc(path + images[image_choice.selectedText()]);}image_choice.onchange = Display; image_choice.removeOption(0);spec ['Images'].hide();Display();
DROP DOWN OPTION #2:
var preview = get('preview1');var image_choice = spec['ImageChoice1'];var path = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";var images = { "NO BACKER": "NO-BACKER.jpg", "MC/VISA": "MC-VISA1.jpg", "MC/VISA/DIS": "MC-VISA-DIS1.jpg", "MC/VISA/AMX": "MC-VISA-AMX.jpg", "MC/VISA/DIS/AMX": "MC-VISA-DIS-AMX.jpg"}function Display() { preview.imgSrc(path + images[image_choice.selectedText()]);}image_choice.onchange = Display; image_choice.removeOption(0);spec ['Images1'].hide();Display();
You're redefining your variables. In the second one don't use the sam variable names (preview, images, path).
Steve
You can read about other advanced tech topics on the [url="http://www.insightsfour51.com/?cat=3"]blog[/url:3ybs0mp586] _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Apr 29, 2009 3:41 am Post subject: |
|
|
I added "_backer" after variable names (preview, images, path)but the thumbnails images still does not show up?
var preview_backer = get('preview1');
var image_choice = spec['ImageChoice1'];
var path_backer = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";
var images_backer = {
"NO BACKER": "NO-BACKER.jpg",
"MC/VISA": "MC-VISA1.jpg",
"MC/VISA/DIS": "MC-VISA-DIS1.jpg",
"MC/VISA/AMX": "MC-VISA-AMX.jpg",
"MC/VISA/DIS/AMX": "MC-VISA-DIS-AMX.jpg"
}
function Display() {
preview_backer.imgSrc(path_backer + images_backer[image_choice.selectedText()]);
}
image_choice.onchange = Display;
image_choice.removeOption(0);
spec ['Images1'].hide();
Display(); |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Apr 29, 2009 4:01 am Post subject: |
|
|
quote: Originally posted by mvang
I added "_backer" after variable names (preview, images, path)but the thumbnails images still does not show up?
var preview_backer = get('preview1');
var image_choice = spec['ImageChoice1'];
var path_backer = "http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/";
var images_backer = {
"NO BACKER": "NO-BACKER.jpg",
"MC/VISA": "MC-VISA1.jpg",
"MC/VISA/DIS": "MC-VISA-DIS1.jpg",
"MC/VISA/AMX": "MC-VISA-AMX.jpg",
"MC/VISA/DIS/AMX": "MC-VISA-DIS-AMX.jpg"
}
function Display() {
preview_backer.imgSrc(path_backer + images_backer[image_choice.selectedText()]);
}
image_choice.onchange = Display;
image_choice.removeOption(0);
spec ['Images1'].hide();
Display();
The code looks good. When I tried to view one of the images nothing shows up: http://www.four51.com/Themes/Custom/fad32e83-e533-45aa-a524-84ab6f5e08f9/DocumentActions/Ortho/image_library/NO-BACKER.jpg
I take this back... The image I tried to view is apparently just a white image.
Are you getting any javascript errors? Do you have firebug installed? If so, put a break point in the Display function to see if the right image is being set.
Steve
You can read about other advanced tech topics on the [url="http://www.insightsfour51.com/?cat=3"]blog[/url:d16hzfs3bh] _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Apr 29, 2009 4:34 am Post subject: |
|
|
| When I remove the backer thumbnail images option in the advanced script tabs the logo shows up and when I go back and add the backer thumbnails the logo does not show up but the backer shows up. MV |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Apr 29, 2009 7:33 am Post subject: |
|
|
quote: Originally posted by mvang
When I remove the backer thumbnail images option in the advanced script tabs the logo shows up and when I go back and add the backer thumbnails the logo does not show up but the backer shows up. MV
I can't keep guess at your problem, and you didn't register any contact information.
Steve
You can read about other advanced tech topics on the [url="http://www.insightsfour51.com/?cat=3"]blog[/url:27iwq5nrfh] _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Mon Aug 10, 2009 12:52 pm Post subject: |
|
|
I'm still having an issue with this script.
I have a total of 3 thumbnail images options: Font, Logo, Backer.
The only drop down images that are showing is the Font option.
var preview = get('preview');
var image_choice = spec['ImageChoice'];
var path = "http://www.four51.com/Themes/Custom/.../DocumentActions/Ortho/image_library/";
var images = {
"AAO Member": "Ortho_AAO_MEMBER.jpg",
"AAO Members": "Ortho_AAO_MEMBERS.jpg", "ABO Diplomate": "Ortho_DIP.jpg",
"ABO Diplomates": "Ortho_DIPS.jpg",
"No Logo": "NoLogo.jpg"}
function Display() {
preview.imgSrc(path + images[image_choice.selectedText()]);}
image_choice.onchange = Display;
image_choice.removeOption(0);
spec ['Images'].hide();
Display();
var preview = get('preview1');
var image_choice = spec['ImageChoice1'];
var path = "http://www.four51.com/Themes/Custom/.../DocumentActions/Ortho/image_library/";
var images = {
"NO BACKER": "NO-BACKER.jpg",
"MC/VISA": "MC-VISA1.jpg",
"MC/VISA/DIS": "MC-VISA-DIS1.jpg",
"MC/VISA/AMX": "MC-VISA-AMX.jpg",
"MC/VISA/DIS/AMX": "MC-VISA-DIS-AMX.jpg"}
function Display() {
preview.imgSrc(path + images[image_choice.selectedText()]);}
image_choice.onchange = Display;
image_choice.removeOption(0);
spec ['Images1'].hide();
Display();
var preview = get('previewfont');
var image_choice = spec['ImageChoiceFont'];
var path = "http://www.four51.com/Themes/Custom/.../DocumentActions/Ortho/image_library/";
var images = {
"Clearface Gothic": "font_clearface.jpg",
"ITC Eras": "font_itceras.jpg",
"New Century Schoolbook": "font_newcenturyschlbk.jpg",
"Park Avenue": "font_parkavenue.jpg",
"Tekton Pro": "font_tekton.jpg"
}
function Display() {
preview.imgSrc(path + images[image_choice.selectedText()]);}
image_choice.onchange = Display;
image_choice.removeOption(0);
spec ['ImagesFont'].hide();
Display(); |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Tue Aug 11, 2009 4:17 pm Post subject: |
|
|
Without Javascript errors I'm really just guessing, but I can see 3 functions with the same name (Display). That's probably going to cause issues, and not necessarily errors. _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Aug 12, 2009 8:05 am Post subject: |
|
|
Product ID#: WIN-800
Description: Statement
Buyer ID: Ortho II Forms |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Aug 12, 2009 10:00 am Post subject: |
|
|
I looked at your product. Just as I said before, you've named 3 different things the same name. That won't work. You have to have unique names for things otherwise it just overrides the previous.
Example:
var preview = get('preview');
var preview = get('preview1');
var preview = get('previewfont');
If you have those 3 lines in your script what is "preview" actually going to be? It's only going to be "get('previewfont') because it's last. _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Aug 12, 2009 12:42 pm Post subject: |
|
|
| Great. Thank You it work.! |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Aug 12, 2009 12:52 pm Post subject: |
|
|
Do you understand what you did wrong? _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Aug 12, 2009 2:01 pm Post subject: |
|
|
Yes.
The 3 variable names (preview, images, path) are the same.
When I change the variable names to be unique I did not add it to the
Display variable. For ex: When you change the variable preview to "ccpreview" the other 3 function that start with Display should also have CC after. DisplayCC.
Thank You. |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Aug 12, 2009 2:21 pm Post subject: |
|
|
Right. It also applies to the function names. _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
|