krewson
asked on
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?
ASKER
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.
<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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
nathans is right you should reload te both pages I think you use the javscript for that purposeit is suitable for you
ASKER
Reloading both pages works.
Thanks if you need help with the javascript to load reload both pages let me know.
If you are a little more specific about your needs and post some code I may be able to help out more