help with Html code please

7 replies
I am having trouble with a scrolling banner on my site, it works fine but I need each advert to open in a new tab or window here is the what I am using this is just the top half to give you an idea

<head>
<title></title>
</head>

<body>
<script type="text/javascript">

/*

Vertical Pausing Slideshow - freely adapted from:

Cross browser Marquee II- © Dynamic Drive (Dynamic Drive DHTML(dynamic html) & JavaScript code library)

For full source code, 100's more DHTML scripts, and TOS, visit Dynamic Drive DHTML(dynamic html) & JavaScript code library

Modified by jscheuer1 for continuous content slideshow. Credit MUST stay intact for use

visit Dynamic Drive Forums

*/



//Specify the marquee's width (in pixels)

var marqueewidth="350px"

//Specify the marquee's height

var marqueeheight="800px"

//Specify the marquee's marquee speed (larger is faster 1-10)

var marqueespeed=1

//Specify initial pause before scrolling in milliseconds

var initPause=1000

//Specify start with Full(1)or Empty(0) Marquee

var full=1

//Pause marquee onMousever (0=no 1=yes)?

var pauseit=1

//Specify images' border

imgBorder=1



var photos=[

//Specify images, optional link, optional target:

//Specify images, optional link, optional target:


['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html'], //Image w/link
#code #html
  • Profile picture of the author Brandon Tanner
    To open a link in a new window, you have to add target="_blank" to your anchor tag (it's not part of the code that you posted here, so you'll have to look for it in another part of the script). For example...

    <a href="http://www.YourLink.com" target="_blank"></a>

    And just so you know... this does not work with all browsers, but it will work with most.
    Signature

    {{ DiscussionBoard.errors[7048721].message }}
  • Profile picture of the author algarve
    Hi Many thanks I did try adding that before but it did not seem to work, I added at the end of 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html' but still left in the //Image w/link so not sure were I am going wrong could the beginning var photos=[

    //Specify images, optional link, optional target:

    //Specify images, optional link, optional target:
    effect it? just at lost ends, many thanks for your help
    {{ DiscussionBoard.errors[7049954].message }}
    • Profile picture of the author Peter ONeill
      Hi Algarve

      var photos=[ //Specify images, optional link, optional target: //Specify images, optional link, optional target: ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html'], //Image w/link ['http://www.cometoportugal.com/banners/bikeland.jpg', 'http://www.bikeland.pt'], //Image w/link ['http://www.cometoportugal.com/banners/Atlantic-ad.jpg', 'http://www.ondeck.com.pt'], //Image w/link ['http://www.cometoportugal.com/banners/autorocha1.jpg', 'http://www.autorocha.com.'], //Image w/link ['http://www.cometoportugal.com/banners/frontrow.jpg', 'http://www.frontrowtransfers.com'], //Image w/link ];


      In this part of the code (starting at line 566) it is asking you if you want to have the links open in a new tab. As it stands you have not specified that you do.

      For example on line 573 you have

      ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html'], //Image w/link

      you need to change it to this

      ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html', '_blank'], //Image w/link


      Hope this helps
      Peter
      {{ DiscussionBoard.errors[7050446].message }}
      • Profile picture of the author algarve
        Originally Posted by Peter ONeill View Post

        Hi Algarve

        var photos=[ //Specify images, optional link, optional target: //Specify images, optional link, optional target: ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html'], //Image w/link ['http://www.cometoportugal.com/banners/bikeland.jpg', 'http://www.bikeland.pt'], //Image w/link ['http://www.cometoportugal.com/banners/Atlantic-ad.jpg', 'http://www.ondeck.com.pt'], //Image w/link ['http://www.cometoportugal.com/banners/autorocha1.jpg', 'http://www.autorocha.com.'], //Image w/link ['http://www.cometoportugal.com/banners/frontrow.jpg', 'http://www.frontrowtransfers.com'], //Image w/link ];


        In this part of the code (starting at line 566) it is asking you if you want to have the links open in a new tab. As it stands you have not specified that you do.

        For example on line 573 you have

        ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html'], //Image w/link

        you need to change it to this

        ['http://www.cometoportugal.com/banners/AS_logo01 (263x182) 2inch (2).jpg', 'http://www.cometoportugal.com/carhire-in-portugal-algarve.html', '_blank'], //Image w/link


        Hope this helps
        Peter
        will give it a bash today
        {{ DiscussionBoard.errors[7052713].message }}
        • Profile picture of the author algarve
          tried it on a test site and all works well, many thanks for all the help given
          {{ DiscussionBoard.errors[7052867].message }}
  • Profile picture of the author Jonas Glad
    I'm always too late to help. x.x
    {{ DiscussionBoard.errors[7055368].message }}
    • Profile picture of the author algarve
      Originally Posted by Jonas Glad View Post

      I'm always too late to help. x.x
      well thank you the thought was there.
      {{ DiscussionBoard.errors[7113223].message }}

Trending Topics