_on.gif"> "Declan" wrote in message news:dc6pj5$m3p$1@forums.macromedia.com...[quote] > 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, > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <11ef0tqs0mh8rcf@corp.supernews.com> [ref] => [htmlstate] => on_nl2br [postusername] => Albina Bigras [ip] => albina@NOSP@Mbi [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Change image source - Macromedia Dynamic HTML

Change image source - Macromedia Dynamic HTML

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,...

  1. #1

    Default 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

  2. #2

    Default 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 doent -

    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" <webforumsusermacromedia.com> wrote in message
    news:dc6pj5$m3p$1forums.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

  3. #3

    Default 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="\"$DOENT_URI\" =
    /products/" -->_on<!--#endif -->.gif">



    "Declan" <webforumsusermacromedia.com> wrote in message
    news:dc6pj5$m3p$1forums.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

Similar Threads

  1. Using CSV to create Image.source
    By Dizzia in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 25th, 10:47 AM
  2. Change source in multiple pages
    By donnie01 in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: July 5th, 06:06 PM
  3. image source
    By tbranden in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 10th, 10:31 PM
  4. Change Apt source
    By Chris Metzler in forum Debian
    Replies: 1
    Last Post: July 4th, 02:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •