Change image based on template loaded in other frame

I have two frames, one is called "navigation" and the other is called "main". I want to change the image that the user clicks in the navigation frame when that page is loaded into the main frame.  Can this be done in ColdFusion or do I need to work this our with JavaScript?
krewsonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
nathansConnect With a Mentor Commented:
As I see it you have three options...

1. JavaScript to Change image.

2. When you click on the page you can reload both pages.

3. Or load the Frames page that will load the new nav pic as well as the body.


Which of the above solutions would you need help with or was this enough information?  In other words if the above was not enough information which choice would you like help with?
0
 
bigbadbCommented:
You should use javascript.  This will probably an onclick event so it will be client side.  CF is all server side and cannot handle image swapping


If you are a little more specific about  your needs and post some code I may be able to help out more
0
 
krewsonAuthor Commented:
I'm not looking to image swap.  This is what I'm looking for in the navigation frame:

<a href="events.cfm" target="main">
<cfif --page in main frame-- eq "events.cfm">
<img src="events.gif">
<cfelse>
<img src="eventsselected.gif">
</cfif>
</a>

so that a different image is loaded for the button that the user is viewing in the other frame.  I just don't know how to refer to the .cfm page in the cfif.



0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
bigbadbCommented:
in your frame window you can do a window.src == 'events.cfm' then set your img.src to be either events.gif or eventsselected.gif.  I think javascript is the best way to do this.  There is also a frame property in javascript you might be able to use
0
 
FRehmanCommented:
nathans is right you should reload te both pages I think you use the javscript for that purposeit is suitable for you
0
 
krewsonAuthor Commented:
Reloading both pages works.
0
 
nathansCommented:
Thanks if you need help with the javascript to load reload both pages let me know.

0
All Courses

From novice to tech pro — start learning today.