Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Declan #1
Change image source
Hi,
Is there a way to change the source of an image depending on what page someone
is viewing?
I am using (for the first time) 'Server-side Include' to bring a menu into
pages of a website. It all works fine but I would like the buttons in the menu
to show a down state if a relevant page is being viewed.
I have been told I can do this with Javascript but I cant find anything that
shows me how this is done.
Many thanks,
Declan Guest
-
Using CSV to create Image.source
So, here's what I have. I've got a datagrid that has a group of comma seperated values. I've been tinkering with it all night trying to get out... -
Change source in multiple pages
I am trying to find out already for long time, but can't seem to find it: I made a mistake with making a photo gallery and now all the seperate... -
image source
Hello I have a problem changing the source of a image. I have a image created like this: <mx:Image id="logo" horizontalAlign="right"... -
Change Apt source
On Thu, 03 Jul 2003 12:49:29 -0500 Abrasive <abrasive@houston.rr.com> wrote: http://www.catb.org/~esr/faqs/smart-questions.html especially... -
How to set Image source from memorystream?
Kevin, Is this page created on the fly in page_load? Or, is one created in the project and then just instatiated as many times as needed? Can... -
Murray *TMM* #2
Re: Change image source
It's easy to do with CSS or with javascript.
With CSS you would have a little stylesheet embedded in the head of each
page that allows you to set the down state for any given button (each button
would have a unique id - for example -
<a href="foo.html" id="button1">...<a href="bar.html" id="button2">
and then your stylesheet would have this -
a#button1 { styles }
on one page, and on another this -
a#button2 { styles }
See how that works?
With javascript, put this in script tags in the head of the document -
function P7_downImage() {
var g7="<imagename>"
var g7url="<pathname>"
if ((g7=MM_findObj(g7))!=null) {g7.src=g7url;}
}
and this on the <body> tag
onload="P7_downImage()"
Then on each page you would need to make two edits:
Set g7 to the *name* of the button (not the file name but the HTML name -
e.g., "productsbutt"), and g7url to the pathname to the button (e.g.,
"images/nav/button3.gif"), and bada bing, bada boom!
There is an excellent tutorial here -
[url]http://www.projectseven.com/support/answers.asp?id=126[/url]
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"Declan" <webforumsuser@macromedia.com> wrote in message
news:dc6pj5$m3p$1@forums.macromedia.com...> Hi,
>
> Is there a way to change the source of an image depending on what page
> someone
> is viewing?
>
> I am using (for the first time) 'Server-side Include' to bring a menu into
> pages of a website. It all works fine but I would like the buttons in the
> menu
> to show a down state if a relevant page is being viewed.
>
> I have been told I can do this with Javascript but I cant find anything
> that
> shows me how this is done.
>
> Many thanks,
>
>
Murray *TMM* Guest
-
Albina Bigras #3
Re: Change image source
you might want to investigate the use of SSI logic instead of using
JavaScript.
Something like:
If you have an image for "Products" called product.gif and its "on"
conterpart is "products_on.gif
change your image code from: (assuming your products pages are in a folder
called /products/)
<img scr="/img/products.gif"> to:
<img src="/img/products<!--#if expr="\"$DOCUMENT_URI\" =
/products/" -->_on<!--#endif -->.gif">
"Declan" <webforumsuser@macromedia.com> wrote in message
news:dc6pj5$m3p$1@forums.macromedia.com...> Hi,
>
> Is there a way to change the source of an image depending on what page
> someone
> is viewing?
>
> I am using (for the first time) 'Server-side Include' to bring a menu into
> pages of a website. It all works fine but I would like the buttons in the
> menu
> to show a down state if a relevant page is being viewed.
>
> I have been told I can do this with Javascript but I cant find anything
> that
> shows me how this is done.
>
> Many thanks,
>
>
Albina Bigras Guest



Reply With Quote

