3 Replies Latest reply: Jan 28, 2014 11:23 AM by Nancy O. RSS

    Dreamweaver CC Library Item with rollover link produces two <body> tags. Why?

    Geoff HH

      I have a library item which is used in two pages and works correctly if it does not contain a rollover arrow with a link taking you to the top of the library item. This produces the following near the top of each of the containing pages:

       

      ...

      </head>

      <body class="indexpage">

      <!-- #BeginLibraryItem "/Library/homemenu.lbi" -->

      <p><a id="top"></a></p>

      ...

       

      Note that the Library Item does not itself have a <body> tag in this original, working version.

       

       

      The problem arises when I insert an image rollover with a link up to #top (which is defined as above).

      First, the Library Item has the following near its top:

       

      ...

      <script ...>

      ... various functions to handle the rollover

      </script>

      <body onLoad="MM_preloadImages('../images/uparrowred2.gif')">

      <p><a id="top"></a></p>

      ...

       

      Secondly, the containing pages now have the following near the top:

       

      ...

      </head>

      <body class="indexpage" onLoad="MM_preloadImages('images/uparrowred2.gif)">

      <!--#BeginLibraryItem "Library/homemenu.lbi" -->

      <script ...>

      ... various functions to handle the rollover

      </script>

      <body onLoad="MM_preloadImages('../images/uparrowred2.gif')">

      <p><a id="top"></a></p>

      ...

       

      It can be seen (shown in red) that the Library Item has correctly transferred the onLoad instruction to the containing page's <body> tag and at the same time altered the address of the GIF image from '../images/xxx.gif' to 'images/xxx.gif'. [The root folder with the various html pages has a number of subfolders including 'images' and 'Library']. But now, unfortunately, the containing pages have two <body> tags with the second one pointing to the wrong location for the GIF image.

       

      Would someone please explain what is going on. I can think of three possibilities: (1) I may be doing something really stupid, (2) there may be a bug in Dreamweaver CC or (3) Library Items may not be allowed to contain anything "complicated" like a rollover. I did see a very old (2007) discussion in this forum suggesting that Library Items were rather limited in what they could contain, but over the intervening six years I would have expected things to have improved.