Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: PHP/JS on same page?

  1. #11
    Join Date
    May 2011
    Posts
    46
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by ApacheTech View Post
    For your consideration:

    There was good reason why the <marquee> tag was depreciated that you might want to think about for your own site.

    * The moving text on the screen was found to detract from the rest of the site, causing users to focus mainly on one area of the screen. This was found to have a detrimental effect to the site as a whole.

    * Due to the way <marquee>s were animated, it caused very choppy movements across the screen. In extreme cases this was found to freeze the website and the browser and the flickering effect of the text as it moved was found to cause proplems for epileptic users on rare occasions.

    * Marquees caused major problems for screen readers and other methods of making webpages easier to use for disabled users. There was no indication of where in the outline of the page the <marquee> should be, this caused screen readers to interpret all <marquee> tags as Headings.

    I understand how you are trying to use the <marquee>, you're one of the rare cases who is using it for it's initial intended purpose; to act as a tickertape style news reel. There are some very effective methods of achieving the same effect in a valid way.

    This is one example:
    PHP Code:
    <form name="marquee">
        <
    input name="text" value=" Whatever text you type here will scroll">
    </
    form>

    <
    script type="text/javascript">
    //<!--
    /* Text box marquee by Dave Methvin, Windows Magazine
    May be used/modified if credit line is retained */

    var ScrollSpeed 100;
    var 
    ScrollChars 1;

    function 
    ScrollMarquee() {
        
    window.setTimeout('ScrollMarquee()',ScrollSpeed);

        var 
    msg document.marquee.text.value;
        
    document.marquee.text.value msg.substring(ScrollChars) + msg.substring(0,ScrollChars);
    }

    ScrollMarquee();

    //-->
    </script> 
    Well as it turns out, today I had a client inquiry because of the marquee scroll, so this gives me incentive to make it work and work well.

    I did read about the problem of choppy text, although I didn't think mine looked too bad, but this is probably very depend on the individual.

    I have been using the Ajax ticker for a long time very effectively, so I suppose one option would be for me to just adapt that since I already know how to implement it. I'd just have to figure out how to make it scroll as opposed to blink.

    I'll be looking over the other suggestions as well.

    Thanks.

    Tom

  2. #12
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    you're correct that the smoothness of the marquee will vary dramatically across browsers/OS/CPU load/probably lots of other factors.

    If you didn't look at Remy Sharp's script yet, I'd still recommend it - it can be implemented very unobtrusively (though I would still recommend "cleaning up" your markup, you don't even really need to to get it to work).

  3. #13
    Join Date
    May 2011
    Posts
    46
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by traq View Post
    you're correct that the smoothness of the marquee will vary dramatically across browsers/OS/CPU load/probably lots of other factors.

    If you didn't look at Remy Sharp's script yet, I'd still recommend it - it can be implemented very unobtrusively (though I would still recommend "cleaning up" your markup, you don't even really need to to get it to work).
    Do you think it is significantly better than the Ajax ticker?

  4. #14
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    are you talking about this one or this one, or something else? (I don't see that either of those scripts have a scrolling feature.)

    But to answer your question, do you need the AJAX functionality? or, are you going ahead with using PHP to define the scroller contents?

    Remy's would be very easy to implement, considering how your markup is currently arranged. But if you want to be able to fetch the contents via ajax, your "ajax ticker" script might be more appropriate.

  5. #15
    Join Date
    May 2011
    Posts
    46
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by traq View Post
    are you talking about this one or this one, or something else? (I don't see that either of those scripts have a scrolling feature.)

    But to answer your question, do you need the AJAX functionality? or, are you going ahead with using PHP to define the scroller contents?

    Remy's would be very easy to implement, considering how your markup is currently arranged. But if you want to be able to fetch the contents via ajax, your "ajax ticker" script might be more appropriate.
    I'm using the second one. I looked at Remy's code and I do not understand how to implement it nor how it would be able to read the text from a file.

  6. #16
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by Atom View Post
    I'm using the second one.
    Are you getting it to scoll simply by using the <marquee> element? Or is there an option in the script I'm missing?
    Quote Originally Posted by Atom View Post
    I looked at Remy's code and I do not understand how to implement it
    First off, it's a jquery plugin. If you're not using jQuery (and don't want to), then it might not be the choice for you.

    Otherwise, basic usage (using your existing markup) would be something like:
    HTML Code:
    <!DOCTYPE html>
    <head>
       <script src="/path/to/your/jquery.js"></script>
       <script src="/path/to/your/jquery.marquee.js"></script>
    </head>
    <body>
        <marquee style="border:solid" bgcolor="#FFFFFF" direction="left" scrollamount="10" loop="2" width="90%">
            <strong>marquee text goes here</strong>
        </marquee>
        <script>
            $( "marquee" ).marquee();
            /* that's all there is too it */
        </script>
    </body>
    </html>
    Quote Originally Posted by Atom View Post
    nor how it would be able to read the text from a file.
    It does not.

    As I said, this would be a good solution to your marquee problem, assuming you don't need the ajax functionality (i.e., you decided to use PHP to write the contents of the marquee).

    If you want to use ajax to write the content of the marquee, then you'd need to use an ajax script -- though, this doesn't mean you couldn't use Remy's script to make the marquee look and function better afterwards.

  7. #17
    Join Date
    May 2011
    Posts
    46
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by traq View Post
    Are you getting it to scoll simply by using the <marquee> element? Or is there an option in the script I'm missing?
    First off, it's a jquery plugin. If you're not using jQuery (and don't want to), then it might not be the choice for you.

    Otherwise, basic usage (using your existing markup) would be something like:
    HTML Code:
    <!DOCTYPE html>
    <head>
       <script src="/path/to/your/jquery.js"></script>
       <script src="/path/to/your/jquery.marquee.js"></script>
    </head>
    <body>
        <marquee style="border:solid" bgcolor="#FFFFFF" direction="left" scrollamount="10" loop="2" width="90%">
            <strong>marquee text goes here</strong>
        </marquee>
        <script>
            $( "marquee" ).marquee();
            /* that's all there is too it */
        </script>
    </body>
    </html>

    It does not.

    As I said, this would be a good solution to your marquee problem, assuming you don't need the ajax functionality (i.e., you decided to use PHP to write the contents of the marquee).

    If you want to use ajax to write the content of the marquee, then you'd need to use an ajax script -- though, this doesn't mean you couldn't use Remy's script to make the marquee look and function better afterwards.
    No, it's not scrolling, just blinking. Here's one of the pages:
    http://www.siftradingsystems.com/Six...Trades_01.html

    I simply assumed that it had a scrolling feature, but having looked, I don't see one.

    So far, I haven't been able to find anything more suitable, then just editing the page itself and using the old fashioned marquee.

  8. #18
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

  9. #19
    Join Date
    May 2011
    Posts
    46
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by traq View Post
    Perhaps an example.
    Right. I can't do much of anything if it's not completely cook book.

    http://www.siftradingsystems.com/BlankPage_New3.php

    That is a better looking scroll, and the page construction looks generally correct. I'll have to try it with the index page and see if everything still works.

    Thanks.

  10. #20
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    Marquees are now available in CSS3!

    PHP Code:
    .marquee {  
      
    overflow-x: -webkit-marquee;
      -
    webkit-marquee-directionahead|auto|backwards|down|forwards|inherit|left|reverse|right|up;
      -
    webkit-marquee-incrementsmall|medium|large;
      -
    webkit-marquee-repetition: {number};
      -
    webkit-marquee-speedslow|normal|fast;
      -
    webkit-marquee-stylealternate|inherit|none|scroll|slide;
      
    font-size:1.4em;

    However, this site shows why you should be careful when using it.

    Also, there is no onmouseover="this.stop()" facility.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •