90 users online (0 members and 90 guests)  


Page 1 of 7 1 2 3 4 5 ... Last
  Results 1 to 15 of 97

Related

  1. How to turn off magic quotes in PHP ?    Forum: PHP Forum
    Replies: 0
  2. Need html text script help    Forum: HTML Forum
    Replies: 2
  3. Rotating text load immediately?    Forum: Javascript Forum
    Replies: 4
  4. Rotating quotes script - help please    Forum: Website Scripts Forum
    Replies: 0
  1. #1
    amyinomaha's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9

    Question Rotating Text/Quotes Script?

    Hi - I am pulling my hair out over here trying to find a script that will rotate a set of quotes for me... can anyone help me or give me one? I am *not* looking for one that will change every time the page is loaded... I am looking for one that will show a quote for a few seconds and then show the next one for a few seconds, etc etc....

    Thanks in advance for any help!!

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there amyinomaha,

    with a little bit of luck this should be just what you need
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Rotating Quotes</title>
    
    <style type="text/css">
    /*<![CDATA[*/
    
    body {
         background-color:#aaaaaa;
       }
    #quotes {
         position:absolute;
         left:50%;
         top:50%;
         margin:-50px 0 0 -81px;
         padding:20px;
         font-family:arial;
         font-size:16px;
         color:#000000;
         width:162px;
         height:100px;
         border:solid 1px #000000;
         background-color:#ffffff;
         text-align:center;
       }
     
    /*//]]>*/
    </style>
        
    <script type="text/javascript">
    //<![CDATA[
    var quote=new Array();
      quote[0]='This is quote number one';    /* add as many quotes as you like!*/
      quote[1]='This is quote number two';
      quote[2]='This is quote number three';
      quote[3]='This is quote number four';
      quote[4]='This is quote number five';
      quote[5]='This is quote number six';
      quote[6]='This is quote number seven';
      quote[7]='This is quote number eight';
      quote[8]='This is quote number nine';
      quote[9]='This is quote number ten';
    
    var speed=2000;    /*this is the time in milliseconds adjust to suit*/
    var q=0;
    
    function showQuote() {
    
         document.getElementById("quotes").innerHTML=quote[q];
         q++;
    if(q==quote.length) {
         q=0;
      }
    }
    setInterval('showQuote()',speed);
       
     //]]>
    </script>
    
    </head>
    <body>
    
    <div id="quotes"></div>
    
    </body>
    </html>
    coothead

  3. #3
    amyinomaha's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9

    Thumbs up Thanks!

    Thanks - that is exactly what I was looking for. You are a life saver!!!

  4. #4
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there amyinomaha,

    you're welcome

    coothead

  5. #5
    amyinomaha's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9

    Question

    okay, well it's almost perfect...
    is there a way to get the quotation marks to show up? i guess it is reading them as part of the script or something? because they won't show up... here is where it is being used (about half way down the page):

    http://www.insitefulwebdesign.com/butch/ski.html

  6. #6
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there amyinomaha,

    perfection is close at hand



    This will produce double quotes, swap them round if you want single...
    Code:
     quote[0]='"The best ski lesson that I've had in 20 years, I will request Butch again."';
    coothead

  7. #7
    amyinomaha's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9

    Unhappy

    For some reason, that doesn't work for me... I get an error and none of the quotes show up...

    I switched the URL to show you this... it's at:
    http://www.insitefulwebdesign.com/butch/ski2.html

    I put the '"..."' on the first quote... but now none show up.

    Any ideas?

  8. #8
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there amyinomaha,

    I am sorry about that
    I did not read your quotes
    The problem is abbreviated words like I've. These need to be escaped like this...I\'ve
    I have checked all your quotes and they now work OK
    Code:
    quote[0]='"The best ski lesson that I\'ve had in 20 years, I will request Butch again."';
      quote[1]='"I moved up two levels in one day - Butch was outstanding!"';
      quote[2]='"Butch gave me the confidence to ski all of Vail Mountain."';
      quote[3]='"He made me feel secure."';
      quote[4]='"I love my instructor, we had fun!"';
      quote[5]='"I didn\'t realize how much I had learned until the next day."';
      quote[6]='"Butch was exceptional; his instructions were clear and easily implemented."';
      quote[7]='"Without Butch\'s help I would have skied green runs only and felt bad about it later."';
    coothead

  9. #9
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Nice , I may have to incorporate this on v.2005

    Dave

  10. #10
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there Dave,

    ' Nice, I may have to incorporate this on v.2005 '
    ...can't wait
    ' Dave was exceptional; his instructions were clear and easily implemented. '
    ' I moved up two levels in one day - Dave was outstanding! '
    ' coothead, is even more repulsive than his avatar '

  11. #11
    amyinomaha's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    9
    thanks coothead... this turned out perfect!!!

  12. #12
    lifestyles's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    1

    Re: Rotating Text/Quotes Script?

    Hi,
    I am looking for the quote script that does not have a limit on the number of lines on the quote. Also can the quote by 'html' in nature ?

    Will this script do that also ?

    Pl confirm

    thanks

    yasas

  13. #13
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: Rotating Text/Quotes Script?

    will you explain better!

    I dont understand what you mean,
    -ALL

  14. #14
    ronnirowland's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2006
    Posts
    5

    Red face Re: Rotating Text/Quotes Script?

    I've got the rotating text/quotes code working - thanks! However, I'd like the first quote to load immediately - right now, there is white space for 5 seconds before the first quote loads. I realize that this is due to the variable speed, but is there a way to make the first quote load immediately?

    Thanks! Ronni

  15. #15
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Rotating Text/Quotes Script?


    Hi there ronnirowland,
    ...is there a way to make the first quote load immediately?
    No problem...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Rotating Quotes</title>
    
    <style type="text/css">
    /*<![CDATA[*/
    
    body {
         color:#000;
         background-color:#aaa;
       }
    #quotes {
         margin:50px auto;
         font-family:verdana,arial,helvetica,sans-serif;
         font-size:16px;
         color:#000;
         width:324px;
         line-height:40px;
         border:1px solid  #000;
         background-color:#fff;
         text-align:center;
       }
     
    /*//]]>*/
    </style>
        
    <script type="text/javascript">
    //<![CDATA[
    var quote=new Array();
        quote[0]='This is quote number one';    /* add as many quotes as you like!*/
        quote[1]='This is quote number two';
        quote[2]='This is quote number three';
        quote[3]='This is quote number four';
        quote[4]='This is quote number five';
        quote[5]='This is quote number six';
        quote[6]='This is quote number seven';
        quote[7]='This is quote number eight';
        quote[8]='This is quote number nine';
        quote[9]='This is quote number ten';
    
    var speed=2000;    /*this is the time in milliseconds adjust to suit*/
    var q=1;
    
    function showQuote() {
    
         document.getElementById("quotes").firstChild.data=quote[q];
         q++;
    if(q==quote.length) {
         q=0;
      }
    }
    setInterval('showQuote()',speed);
       
     //]]>
    </script>
    
    </head>
    <body>
    
    <div id="quotes">This is quote number one</div>
    
    </body>
    </html>



Page 1 of 7 1 2 3 4 5 ... Last

Tags for this Thread