Loading ...
Sorry, an error occurred while loading the content.
 

Advice on parameters.

Expand Messages
  • Robin Chapple
    I am using Quackit code to scroll a message across a page:
    Message 1 of 4 , Jun 1, 2010
      I am using Quackit code to scroll a message across a page:

      <script type="text/javascript" src="xbMarquee.js"></script>
      <script type="text/javascript">
      <!--//set the marquee parameters
      function init() { ltr_marquee.start(); }
      var ltr_marquee_Text = 'Book your accommodation now';
      var ltr_marquee_Direction = 'right';
      var ltr_marquee_Contents='<span style="font-family:Comic Sans
      MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text + '</span>';
      ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
      ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
      window.setTimeout( init, 200);
      --> </script>

      It appears that the message stops scrolling after a foxed interval,
      if that is so which parameter controls the time?

      I would also like the message to start appearing immediately that it
      disappears. How do I achieve that?

      Many thanks,

      Robin Chapple
    • David Smart
      Using FireFox and looking at their JavaScript page http://www.quackit.com/javascript/codes/javascript_scroll.cfm I get fairly non-nice behaviour. The
      Message 2 of 4 , Jun 3, 2010
        Using FireFox and looking at their JavaScript page
        http://www.quackit.com/javascript/codes/javascript_scroll.cfm I get fairly
        non-nice behaviour. The right-to-left scroll stops working after one or two
        passes and the left-to-right scroll cuts off 3/4 of the way across the
        coloured bar, but it does seem to keep scrolling forever.

        There is no time limit that I can see in the parameters. A quick look
        through the JS code doesn't show any time limit either, or any reason why
        the timer would stop running. So, I suspect that the text gets "stuck"
        somewhere where it's not visible, due to a bug in the code (which is quite
        large at ~ 500 lines).

        So, if it's a nuisance, you'll need to find another scroller, or devote the
        time to debug the code.

        Have you reported the problem to the author? After all, quackit has a web
        site and is therefore clearly proud of its code and presumably would be
        interested in problem reports. Send them your whole HTML and any associated
        JS files - preferably from a cut-down page that demonstrates just the
        problem - plus full information about the browsers and their levels that
        you've seen this on.

        Also, PLEASE, when you contact them don't say "It appears that the message
        stops scrolling after a fixed interval ...". That's meaningless. Is it
        seconds, minutes, hours or days? Give detailed information. Also, count
        the number of repetitions of the scroll before it stops, That might be
        important. But at least let them know how long they need to wait before
        they know they haven't encountered the same problem as you.

        Regards, Dave S

        ----- Original Message -----
        From: "Robin Chapple" <robinski@...>
        To: <JavaScript_Official@yahoogroups.com>
        Sent: Wednesday, June 02, 2010 9:25 AM
        Subject: [unclassified] [JavaScript] Advice on parameters.


        >I am using Quackit code to scroll a message across a page:
        >
        > <script type="text/javascript" src="xbMarquee.js"></script>
        > <script type="text/javascript">
        > <!--//set the marquee parameters
        > function init() { ltr_marquee.start(); }
        > var ltr_marquee_Text = 'Book your accommodation now';
        > var ltr_marquee_Direction = 'right';
        > var ltr_marquee_Contents='<span style="font-family:Comic Sans
        > MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text + '</span>';
        > ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
        > ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
        > window.setTimeout( init, 200);
        > --> </script>
        >
        > It appears that the message stops scrolling after a foxed interval,
        > if that is so which parameter controls the time?
        >
        > I would also like the message to start appearing immediately that it
        > disappears. How do I achieve that?
        >
        > Many thanks,
        >
        > Robin Chapple
        >
        >
        >
        >
        > ------------------------------------
        >
        > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
        >
        >
        >


        --------------------------------------------------------------------------------



        No virus found in this incoming message.
        Checked by AVG - www.avg.com
        Version: 8.5.437 / Virus Database: 271.1.1/2914 - Release Date: 06/02/10
        18:25:00
      • Tim Sabin
        Each time through init () you are creating a new xbMarquee object. This could be a problem; you ll end up with a bunch of objects where one would
        Message 3 of 4 , Jun 3, 2010
          Each time through init () you are creating a new xbMarquee object. This
          could be a problem; you'll end up with a bunch of <span> objects where
          one would suffice. Have you tried removing the code from init (), and
          not timing out at all? I think this would work. I.e.:

          <script type="text/javascript" src="xbMarquee.js"></script>
          <script type="text/javascript">
          <!--//set the marquee parameters
          var ltr_marquee_Text = 'Book your accommodation now';
          var ltr_marquee_Direction = 'right';
          var ltr_marquee_Contents='<span style="font-family:Comic Sans
          MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text +'</span>';
          ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
          ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
          ltr_marquee.start();
          --> </script>

          --Tim Sabin


          On 6/1/2010 7:25 PM, Robin Chapple wrote:
          > I am using Quackit code to scroll a message across a page:
          >
          > <script type="text/javascript" src="xbMarquee.js"></script>
          > <script type="text/javascript">
          > <!--//set the marquee parameters
          > function init() { ltr_marquee.start(); }
          > var ltr_marquee_Text = 'Book your accommodation now';
          > var ltr_marquee_Direction = 'right';
          > var ltr_marquee_Contents='<span style="font-family:Comic Sans
          > MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text +'</span>';
          > ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
          > ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
          > window.setTimeout( init, 200);
          > --> </script>
          >
          > It appears that the message stops scrolling after a foxed interval,
          > if that is so which parameter controls the time?
          >
          > I would also like the message to start appearing immediately that it
          > disappears. How do I achieve that?
          >
          > Many thanks,
          >
          > Robin Chapple
          >
          >
          >
          >
          > ------------------------------------
          >
          > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
          >
          >
          >
          >
          >
        • David Smart
          Hi Tim That code is straight from the quackit web site, including the setTimeout call of init, which is there to give the page time to finish loading before
          Message 4 of 4 , Jun 4, 2010
            Hi Tim

            That code is straight from the quackit web site, including the setTimeout
            call of init, which is there to give the page time to finish loading before
            the call to init.

            The setTimeout will only call init once. (It's setInterval that would call
            it multiple times.) After the first call, the marquee code itself uses
            further setTimeout calls to keep itself going.

            Regards, Dave S

            ----- Original Message -----
            From: "Tim Sabin" <tim@...>
            To: <JavaScript_Official@yahoogroups.com>
            Sent: Friday, June 04, 2010 8:58 AM
            Subject: Re: [JavaScript] Advice on parameters.


            > Each time through init () you are creating a new xbMarquee object. This
            > could be a problem; you'll end up with a bunch of <span> objects where
            > one would suffice. Have you tried removing the code from init (), and
            > not timing out at all? I think this would work. I.e.:
            >
            > <script type="text/javascript" src="xbMarquee.js"></script>
            > <script type="text/javascript">
            > <!--//set the marquee parameters
            > var ltr_marquee_Text = 'Book your accommodation now';
            > var ltr_marquee_Direction = 'right';
            > var ltr_marquee_Contents='<span style="font-family:Comic Sans
            > MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text +'</span>';
            > ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
            > ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
            > ltr_marquee.start();
            > --> </script>
            >
            > --Tim Sabin
            >
            >
            > On 6/1/2010 7:25 PM, Robin Chapple wrote:
            >> I am using Quackit code to scroll a message across a page:
            >>
            >> <script type="text/javascript" src="xbMarquee.js"></script>
            >> <script type="text/javascript">
            >> <!--//set the marquee parameters
            >> function init() { ltr_marquee.start(); }
            >> var ltr_marquee_Text = 'Book your accommodation now';
            >> var ltr_marquee_Direction = 'right';
            >> var ltr_marquee_Contents='<span style="font-family:Comic Sans
            >> MS;font-size:12pt;white-space:nowrap;">' + ltr_marquee_Text +'</span>';
            >> ltr_marquee = new xbMarquee('ltr_marquee', '19px', '800px', 6, 100,
            >> ltr_marquee_Direction, 'scroll', ltr_marquee_Contents);
            >> window.setTimeout( init, 200);
            >> --> </script>
            >>
            >> It appears that the message stops scrolling after a foxed interval,
            >> if that is so which parameter controls the time?
            >>
            >> I would also like the message to start appearing immediately that it
            >> disappears. How do I achieve that?
            >>
            >> Many thanks,
            >>
            >> Robin Chapple
            >>
            >>
            >>
            >>
            >> ------------------------------------
            >>
            >> Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
            >>
            >>
            >>
            >>
            >>
            >
            >
            > ------------------------------------
            >
            > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
            >
            >
            >


            --------------------------------------------------------------------------------



            No virus found in this incoming message.
            Checked by AVG - www.avg.com
            Version: 8.5.437 / Virus Database: 271.1.1/2916 - Release Date: 06/03/10
            18:25:00
          Your message has been successfully submitted and would be delivered to recipients shortly.