4 Replies Latest reply on Mar 16, 2010 8:37 AM by Clix websites

    Link not working...??

    Clix websites

      I'm trying to link to an image which will open in a new window using Behaviours > Open Browser Window. When tested in the browser it merely works as a normal link, replacing the first page with a new one with the image on it.

       

      Here' the code:

       

      <a href="image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="MM_openBrWindow('image-files/red-dawn-bw-b.jpg','reddawn','scrollbars=yes,width= 400,height=600')">View larger version</a></p>

       

      Thanks a lot!

      Josh

        • 1. Re: Link not working...??
          osgood_ Level 8

          Clix websites wrote:

           

          I'm trying to link to an image which will open in a new window using Behaviours > Open Browser Window. When tested in the browser it merely works as a normal link, replacing the first page with a new one with the image on it.

           

          Here' the code:

           

          <a href="image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="MM_openBrWindow('image-files/red-dawn-bw-b.jpg','reddawn','scrollbars= yes,width=400,height=600')">View larger version</a></p>

           

          Thanks a lot!

          Josh

           

          First you need to make sure you have the associated javacript on the page which is needed to open a new browser window. It will be in the head section of your page near the top and should look something like below:

           

          <script type="text/javascript">
          <!--
          function MM_openBrWindow(theURL,winName,features) { //v2.0
            window.open(theURL,winName,features);
          }
          //-->
          </script>

           

          Secondly if you actually put a link in your anchor tag, which you have done (see below)

           

          <a href="image-files/red-dawn-bw-b.jpg"

          your telling the browser to open a new browser window.

           

          You should change the link to

           

          <a href="#" if you only want the new browser window to open?

          • 2. Re: Link not working...??
            Clix websites Level 1

            Thanks so much for that! It's done the trick.

            But I've just seen an extension called Smart Link - accessed by going Behaviours>CB Tools>Smart Link when installed. I'd like to use it so people without javascript enabled can still see the linked image. I've tried it out and do get a new window opening on top the first one but not with the intended image in. It's a copy of the bottom window. Here's the code:

             

            <a href="#image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="dpSmartLink('#image-files/red-dawn-bw-b.jpg','redawnbw',600,600,'c:0','sc','r'); return document.MM_returnValue">View larger version</a></p>

             

            Thanks a lot again, Josh.

            • 3. Re: Link not working...??
              osgood_ Level 8

              Clix websites wrote:

               

              Thanks so much for that! It's done the trick.

              But I've just seen an extension called Smart Link - accessed by going Behaviours>CB Tools>Smart Link when installed. I'd like to use it so people without javascript enabled can still see the linked image. I've tried it out and do get a new window opening on top the first one but not with the intended image in. It's a copy of the bottom window. Here's the code:

               

              <a href="#image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="dpSmartLink('#image-files/red-dawn-bw-b.jpg','redawnbw',600,600,'c:0', 'sc','r');return document.MM_returnValue">View larger version</a></p>

               

              Thanks a lot again, Josh.

               

              Change ths:

              <a href="#image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="dpSmartLink('#image-files/red-dawn-bw-b.jpg','redawnbw',600,600,'c:0', 'sc','r');return document.MM_returnValue">View larger version</a></p>

               

              To this

              <p><a href="image-files/red-dawn-bw-b.jpg" title="Red Dawn BW" onclick="dpSmartLink(this.href,'newWin',600,600,'c:0', 'sc','r');return document.MM_returnValue">View larger version</a></p>

               

              1 person found this helpful
              • 4. Re: Link not working...??
                Clix websites Level 1

                Thanks that's done it - you've been a big help!