7 Replies Latest reply on Sep 19, 2007 4:21 AM by wildwood ladybug

    swap image code different in newer version of Dreamweaver?

    wildwood ladybug Level 1
      I was using Dreamweaver MX. When adding a swap image behavior, the code would become part of the anchor tag.
      I recently upgraded to Dreamweaver CS3. Now the swap image behavior is adding the code to the image tag .

      Why has this changed, or am I doing something wrong now?
        • 1. Re: swap image code different in newer version of Dreamweaver?
          Level 7
          The way to do this is the following -

          1. Select the image tag and apply your LINK using the property inspector.
          2. Click on the <a> tag on the tag selector.
          3. Apply your behavior to the <a> tag, not to the <img> tag.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "wildwood ladybug" <webforumsuser@macromedia.com> wrote in message
          news:fcolu2$hcj$1@forums.macromedia.com...
          >I was using Dreamweaver MX. When adding a swap image behavior, the code
          >would
          > become part of the anchor tag.
          > I recently upgraded to Dreamweaver CS3. Now the swap image behavior is
          > adding
          > the code to the image tag .
          >
          > Why has this changed, or am I doing something wrong now?
          >
          >
          > WITH DREAMWEAVER MX
          > <a href="services.htm" onMouseOut="MM_swapImgRestore();
          > window.status='';return true"
          > onMouseOver="MM_swapImage('services','','link-services2.jpg',1);
          > window.status='services';return true;">
          > <img src="link-services.jpg" name="services" width="90" height="30"
          > border="0"></a>
          >
          > WITH DREAMWEAVER CS3
          > <img src="link-services.jpg" name="services" width="90" height="30"
          > border="0"
          > onClick="MM_goToURL('parent','services.htm');return
          > document.MM_returnValue"
          > onMouseOver="MM_swapImage('services','','link_services2.gif',1)"
          > onMouseOut="MM_swapImgRestore()">
          >


          • 2. Re: swap image code different in newer version of   Dreamweaver?
            Level 7
            Depending on how you have your behavior panel setup, the code is
            attached to the <a> or the <img> - check the "Show Events For" under the
            behavior panel's + and make sure it is set for HTML 4.01, then look for
            the item in question and see if it is <a> onMouseOut or just onMouseOut
            (the <a> version puts the code in a <a> tag around the image)
            Paul Davis
            http://www.kaosweaver.com/
            Visit us for dozens of useful Dreamweaver Extensions.

            http://www.communitymx.com/
            Partner at Community MX - Extend your knowledge

            wildwood ladybug wrote:
            > I was using Dreamweaver MX. When adding a swap image behavior, the code would
            > become part of the anchor tag.
            > I recently upgraded to Dreamweaver CS3. Now the swap image behavior is adding
            > the code to the image tag .
            >
            > Why has this changed, or am I doing something wrong now?
            >
            >
            > WITH DREAMWEAVER MX
            > <a href="services.htm" onMouseOut="MM_swapImgRestore();
            > window.status='';return true"
            > onMouseOver="MM_swapImage('services','','link-services2.jpg',1);
            > window.status='services';return true;">
            > <img src="link-services.jpg" name="services" width="90" height="30"
            > border="0"></a>
            >
            > WITH DREAMWEAVER CS3
            > <img src="link-services.jpg" name="services" width="90" height="30" border="0"
            > onClick="MM_goToURL('parent','services.htm');return document.MM_returnValue"
            > onMouseOver="MM_swapImage('services','','link_services2.gif',1)"
            > onMouseOut="MM_swapImgRestore()">
            >
            • 3. Re: swap image code different in newer version of Dreamweaver?
              wildwood ladybug Level 1
              I hear what Murry is saying and I added the link to the image first so that I would have an <a> tag to click on in the property inspector. That worked.

              If I am hearing Paul Davis right he is saying that I can change a setting somewhere so that the behavior will automatically go into the <a> tag rather than the <img> tag?
              Paul I followed your instructions down to making sure that the behavior panel is set for HTML 4.01, but after that you lost me. Then you say to "look for
              the item in question and see if it is <a> onMouseOut or just onMouseOut " . Where do I do that and does that mean that I can change a setting and have a choice to make it go to the <a> tag on default?
              • 4. Re: swap image code different in newer version of Dreamweaver?
                Level 7
                > If I am hearing Paul Davis right he is saying that I can change a setting
                > somewhere so that the behavior will automatically go into the <a> tag
                > rather
                > than the <img> tag?

                You can do it by applying the behavior to the <img> tag, and then editing
                the behavior's event in the Behaviors panel, by changing the event dropdown
                from "onclick" to "<A> onclick". The curious "<A>" is there to indicate
                that by selecting that event, the behavior will be removed from the <img>
                and placed in an <a> tag that will wrap the image.

                Either way will work. The former is the better way in my opinion.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.dreamweavermx-templates.com - Template Triage!
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                ==================


                "wildwood ladybug" <webforumsuser@macromedia.com> wrote in message
                news:fcp0eq$dq$1@forums.macromedia.com...
                >I hear what Murry is saying and I added the link to the image first so that
                >I
                > would have an <a> tag to click on in the property inspector. That worked.
                >
                > If I am hearing Paul Davis right he is saying that I can change a setting
                > somewhere so that the behavior will automatically go into the <a> tag
                > rather
                > than the <img> tag?
                > Paul I followed your instructions down to making sure that the behavior
                > panel
                > is set for HTML 4.01, but after that you lost me. Then you say to "look
                > for
                > the item in question and see if it is <a> onMouseOut or just onMouseOut "
                > .
                > Where do I do that and does that mean that I can change a setting and have
                > a
                > choice to make it go to the <a> tag on default?
                >


                • 5. Re: swap image code different in newer version of Dreamweaver?
                  wildwood ladybug Level 1
                  Okay, I just noticed that this version has added those "<a> onMouseOut" etc. choices. Didn't see that before. Cool.

                  Thanks guys, that answers what I needed to know. I'm sure there is a lot of new stuff in this version that I'll be running across in next few weeks.Thanks so much for your help.
                  • 6. Re: swap image code different in newer version of Dreamweaver?
                    Level 7
                    > Okay, I just noticed that this version has added those "<a> onMouseOut"
                    > etc.
                    > choices. Didn't see that before. Cool.

                    It's been there since DW2!

                    --
                    Murray --- ICQ 71997575
                    Adobe Community Expert
                    (If you *MUST* email me, don't LAUGH when you do so!)
                    ==================
                    http://www.dreamweavermx-templates.com - Template Triage!
                    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                    ==================


                    "wildwood ladybug" <webforumsuser@macromedia.com> wrote in message
                    news:fcqu80$hul$1@forums.macromedia.com...
                    > Okay, I just noticed that this version has added those "<a> onMouseOut"
                    > etc.
                    > choices. Didn't see that before. Cool.
                    >
                    > Thanks guys, that answers what I needed to know. I'm sure there is a lot
                    > of
                    > new stuff in this version that I'll be running across in next few
                    > weeks.Thanks
                    > so much for your help.
                    >


                    • 7. Re: swap image code different in newer version of Dreamweaver?
                      wildwood ladybug Level 1
                      I'm sure you are right... and as my sweet old granny used to say, "If it had been a snake, it would have bit me!"

                      Guess I just never saw it because I never had a need for it since Dreamweaver, for whatever reason, was inserting the code into the proper tag automatically.

                      But again, guys, its good to have you point this out to me and I'm always happy to learn. Thanks for all your expert help.