42 users online (0 members and 42 guests)  


Page 4 of 7 First 1 2 3 4 5 6 7 Last
  Results 46 to 60 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. #46
    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 Yerl,

    did your original code work with joomla?

    If the answer is yes, try changing all instances of timer in the script to speed.

    I have no experience of joomla, so, unfortunately, cannot be more helpful than that.

  2. #47
    Yerl's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    9

    Talking Re: Rotating Text/Quotes Script?

    I have one thing to say to you my friend:You are the man!

    Thanks alot that got the script working correctly. Great script

  3. #48
    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?

    It was an just an educated guess.

  4. #49
    insidiousraven's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2009
    Posts
    2

    Re: Rotating Text/Quotes Script?

    I am looking for a script exactly like this that will display random quotes only on refresh, but will also cycle through the quotes when 'next' or 'previous' buttons or pushed. I can't find a solution for this anywhere, and would love it if you could share your wisdom.

    Thanks in advance!

  5. #50
    insidiousraven's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2009
    Posts
    2

    Re: Rotating Text/Quotes Script?

    Mostly, I just want to figure out how to do the button part. I have the quotes rotating on refresh, but I want to add buttons to the bottom so the viewer can manually cycle through them.

    P.S. Sorry, couldn't figure out how to edit my previous post.

  6. #51
    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 insidiousraven,

    and a warm welcome to these forums.

    Does this help the cause...
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>Rotating Quotes</title>
    
    <style type="text/css">
    #container {
        width:20em;
        padding:1em;
        border:1px solid #ccc;
        margin:auto;
        overflow:hidden;
     }
    #quote {
        font-style:oblique;
     }
    #author {
        margin:0.5em 1.5em 0.5em 0 ;
        font-family:'times new roman',serif;
        text-align:right;
     }
    #left,#right {
        float:left;
        font-size:1.5em;
        cursor:pointer;
     }
    #right {
        float:right;
     }
    </style>
    
    <script type="text/javascript">
    
    /********************************************* edit these values to suit *********************************************/
    
      var quotes=[
                   '"This is quote number one",author one',
                   '"This is quote number two",author two',
                   '"This is quote number three",author three',
                   '"This is quote number four",author four',
                   '"This is quote number five",author five',
                   '"This is quote number six",author six',
                   '"This is quote number seven",author seven',
                   '"This is quote number eight",author eight',
                   '"This is quote number nine",author nine',
                   '"This is quote number ten",author ten'
                  ];
    
    
    /*********************************************************************************************************************/
    
    
    function showQuote() {
       obj1=document.getElementById('quote');
       obj2=document.getElementById('author');
    
       num=Math.floor(Math.random()*quotes.length);
    
       obj1.firstChild.nodeValue=quotes[num].split(',')[0];
       obj2.firstChild.nodeValue=quotes[num].split(',')[1];
    
    document.getElementById('right').onclick=function() {
       num++;
    if(num==quotes.length) {
       num=0;
     }
       obj1.firstChild.nodeValue=quotes[num].split(',')[0];
       obj2.firstChild.nodeValue=quotes[num].split(',')[1];
     }
    document.getElementById('left').onclick=function() {
       num--;
    if(num==-1) {
       num=quotes.length-1;
     }
       obj1.firstChild.nodeValue=quotes[num].split(',')[0];
       obj2.firstChild.nodeValue=quotes[num].split(',')[1];
      }
     }
    
    if(window.addEventListener){
       window.addEventListener('load',showQuote,false);
     }
    else { 
    if(window.attachEvent){
       window.attachEvent('onload',showQuote);
      }
     }
    </script>
    
    </head>
    <body>
    
    <div id="container">
    
    <div id="quote">&nbsp;</div>
    
    <div id="author">&nbsp;</div>
    
    <span id="left"></span>
    <span id="right"></span>
    
    </div>
    
    </body>
    </html>
    
    

  7. #52
    JenRS's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2010
    Posts
    3

    Question Re: Rotating Text/Quotes Script?

    This script is just what I was looking for. Thanks!

    I'm having a slight problem with it though. I wanted to have more than the 10 quotes, so I just added more lines thinking it would work but an error comes up saying that "]" is expected on line 69.

    Can you tell me how to add more quotes?

    Thank you!
    Jennie

    Quote Originally Posted by coothead View Post
    Hi there Yerl,

    try it like this...
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>Rotating Quotes</title>
    
    <style type="text/css">
    html,body{
        height:100%;
        margin:0;
        padding:0;
     }
    body {
        min-width:290px;
        min-height:140px;
        background-color:#fff;
        text-align:center;
     }
    #vertical{
        width:100%;
        height:50%;
        margin-top:-70px;/* half vertical height*/
        float:left;
     }
    #quotes {
        width:250px;
        height:100px;
        padding:20px;
        margin:auto;
        font-family:arial,sans-serif;
        font-size:26px;
        color:#000;
        background-color:#fff;
        text-align:center;
        overflow:auto;    /* allow content to scroll inside element */
        clear:both;
     }
    .qname {
         padding:0;
         font-family:arial,sans-serif;
         font-size:12px;
         color:#000;
         background-color:#fff;
         text-align:right;
       }
    
    </style>
    
    <script type="text/javascript">
    
    /********************************************* edit these values to suit *********************************************/
    
      var quotes=[
                   'This is quote number one<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number two<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number three<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number four<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number five<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number six<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number seven<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number eight<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number nine<br><div class="qname">-Ufocomet<\/div>',
                   'This is quote number ten<br><div class="qname">-Ufocomet<\/div>'
                  ];
    
       var timer=4*1000; /* this is set to 5 seconds */
    
    /*********************************************************************************************************************/
    
       var temp;
    
    function showQuote() {
       num=Math.floor(Math.random()*quotes.length);
    if(num==temp){
       showQuote();
     }
    else {
       document.getElementById('quotes').innerHTML=quotes[num];
       temp=num;
       setTimeout(function(){showQuote()},timer);
      }
     }
    if(window.addEventListener){
       window.addEventListener('load',showQuote,false);
     }
    else { 
    if(window.attachEvent){
       window.attachEvent('onload',showQuote);
      }
     }
    </script>
    
    </head>
    <body>
    
    <div id="vertical"></div>
    <div id="quotes">&nbsp;</div>
    
    </body>
    </html>
    

  8. #53
    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 JenRS,

    and a warm welcome to these forums.

    May I see the full page code that you are using so that I may check for errors?

  9. #54
    JenRS's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2010
    Posts
    3

    Re: Rotating Text/Quotes Script?

    Thanks for the welcome and the quick reply!

    I have pasted in the code I was using which is the same as the code on page 5 of this thread. I may have changed some of the CSS though.

    I have 12 quotes here and it should come up with the error I mentioned.

    -Jennie

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title>Rotating Quotes</title>
    
    <style type="text/css">
    html,body{
        height:100%;
        margin:0;
        padding:0;
     }
    body {
        min-width:290px;
        min-height:140px;
        background-color:#fff;
        text-align:center;
     }
    #vertical{
        width:100%;
        height:50%;
        margin-top:-70px;/* half vertical height*/
        float:left;
     }
    #quotes {
        width:250px;
        height:100px;
        padding:20px;
        margin:auto;
        font-family:arial,sans-serif;
        font-size:12px;
        color:#000;
        background-color:#fff;
        text-align:left;
        overflow:auto;    /* allow content to scroll inside element */
        clear:both;
     }
    .qname {
         padding:0;
         font-family:arial,sans-serif;
         font-size:10px;
         color:#000;
         background-color:#fff;
         text-align:right;
       }
    
    </style>
    
    <script type="text/javascript">
    
    /********************************************* edit these values to suit *********************************************/
    
      var quotes=[
                   '"I just want to let you know that you have a LIFE TIME customer...this popcorn is amazing, we have allready eaten 5 of ten pounds, I just wanted to thank you and let you know how much we love it !!!"<br><div class="qname">-Chanel G. : McDonald, PA<\/div>',
                   '"I found mushroom popcorn without having to buy 50 lbs! Thanks! My husband has wanted this for years for making caramel corn and I can finally get it for him without figuring out how to store a lifetime supply. thanks again!"<br><div class="qname">-Dianne M : Hamilton NJ<\/div>',
                   '"Awsme product! Will buy from again most definately! othr sellers can\'t compare!"<br><div class="qname">-Sumer W : Camas WA<\/div>',
                   '"WOW!! Just received the popcorn, popped some and OH WOW. Beautiful!! Thanks!"<br><div class="qname">-Amy E : Moses Lake WA<\/div>',
                   '"Prompt delivery of 1st class product. Seller gladly accomodated my order change"<br><div class="qname">-Patrick M : Buena Park CA<\/div>',
                   '"I have become addicted to this it\'s great"<br><div class="qname">-Elizabeth D : Rockford IL<\/div>',
                   '"The popcorn was great as was the service. Great transaction, Thanks!!!!!!!!!"<br><div class="qname">-Randy S : Sahuarita AZ<\/div>',
                   '"GREAT TASTING POPCORN HAPPY!!! HAPPY!!! "<br><div class="qname">-Billy H : Coffeyville KS<\/div>',
                   '"Perfect Popcorn!!! This is the BEST!!!! Thanks!"<br><div class="qname">-Dominic V : Randolph VT<\/div>',
                   '"I received your package in the mail and I couldn\'t wait!!! We popped the corn per your instructions and OMGoodness it was heavenly. We made enough for the next day and it was still good!!! The taste of the popcorn lived up to my expectations!!!!"<br><div class="qname">-Lillian C : Mesa AZ<\/div>'
    	      '"Fantastic seller &amp; the best popcorn movie popcorn out there!! Will be back! =)"<br><div class="qname">-Michael D : Winnetka IL<\/div>'
    		'"Your popcorn arrived today and we couldn\'t wait to try it.  WOW!  As you know it\'s great.  We really enjoyed the mushroom style.  You will be hearing from us again.  You must enjoy selling a product that brings happiness like your popcorn."<br><div class="qname">-Tom M : Manhattan MT<\/div>'
                  ];
    
       var timer=4*1000; /* this is set to 5 seconds */
    
    /*********************************************************************************************************************/
    
       var temp;
    
    function showQuote() {
       num=Math.floor(Math.random()*quotes.length);
    if(num==temp){
       showQuote();
     }
    else {
       document.getElementById('quotes').innerHTML=quotes[num];
       temp=num;
       setTimeout(function(){showQuote()},timer);
      }
     }
    if(window.addEventListener){
       window.addEventListener('load',showQuote,false);
     }
    else { 
    if(window.attachEvent){
       window.attachEvent('onload',showQuote);
      }
     }
    </script>
    
    </head>
    <body>
    
    <table border="2" cellpadding="5" cellspacing="0" summary="">
    <tr><td valign="middle">
    Our Customers Say...
    <div id="vertical"></div>
    <div id="quotes">&nbsp;</div>
    </td></tr>
    </table>
    
    
    </body>
    </html>

    Quote Originally Posted by coothead View Post
    Hi there JenRS,

    and a warm welcome to these forums.

    May I see the full page code that you are using so that I may check for errors?

  10. #55
    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 JenRS,

    The problem was, as I anticipated, in the quotes array.

    Every quote in the array must have a comma at the end of the line thus...
    Code:
    
    '"your quote code" your HTML',
    
    ...except the very last quote in the array.

    This is your corrected array...

    Code:
    
      var quotes=[
                   '"I just want to let you know that you have a LIFE TIME customer...this popcorn is amazing, we have allready eaten 5 of ten pounds, I just wanted to thank you and let you know how much we love it !!!"<br><div class="qname">-Chanel G. : McDonald, PA<\/div>',
                   '"I found mushroom popcorn without having to buy 50 lbs! Thanks! My husband has wanted this for years for making caramel corn and I can finally get it for him without figuring out how to store a lifetime supply. thanks again!"<br><div class="qname">-Dianne M : Hamilton NJ<\/div>',
                   '"Awsme product! Will buy from again most definately! othr sellers can\'t compare!"<br><div class="qname">-Sumer W : Camas WA<\/div>',
                   '"WOW!! Just received the popcorn, popped some and OH WOW. Beautiful!! Thanks!"<br><div class="qname">-Amy E : Moses Lake WA<\/div>',
                   '"Prompt delivery of 1st class product. Seller gladly accomodated my order change"<br><div class="qname">-Patrick M : Buena Park CA<\/div>',
                   '"I have become addicted to this it\'s great"<br><div class="qname">-Elizabeth D : Rockford IL<\/div>',
                   '"The popcorn was great as was the service. Great transaction, Thanks!!!!!!!!!"<br><div class="qname">-Randy S : Sahuarita AZ<\/div>',
                   '"GREAT TASTING POPCORN HAPPY!!! HAPPY!!! "<br><div class="qname">-Billy H : Coffeyville KS<\/div>',
                   '"Perfect Popcorn!!! This is the BEST!!!! Thanks!"<br><div class="qname">-Dominic V : Randolph VT<\/div>',
                   '"I received your package in the mail and I couldn\'t wait!!! We popped the corn per your instructions and OMGoodness it was heavenly. We made enough for the next day and it was still good!!! The taste of the popcorn lived up to my expectations!!!!"<br><div class="qname">-Lillian C : Mesa AZ<\/div>',
    	      '"Fantastic seller &amp; the best popcorn movie popcorn out there!! Will be back! =)"<br><div class="qname">-Michael D : Winnetka IL<\/div>',
    		'"Your popcorn arrived today and we couldn\'t wait to try it.  WOW!  As you know it\'s great.  We really enjoyed the mushroom style.  You will be hearing from us again.  You must enjoy selling a product that brings happiness like your popcorn."<br><div class="qname">-Tom M : Manhattan MT<\/div>'
                  ];
    
    I hope that this gets you going again.

  11. #56
    JenRS's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2010
    Posts
    3

    Thumbs up Re: Rotating Text/Quotes Script?

    AWESOME!! Thank you so much!! I just knew it had to be something little like that but could not figure it out.

    Thanks for the solution and also for explaining the problem. Now I understand a little bit more...

    Thanks again!!
    Jennie

  12. #57
    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?

    No problem, you're very welcome.

  13. #58
    jmark's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2010
    Posts
    3

    Re: Rotating Text/Quotes Script?

    Hello. I am googling for few hours and couldn't find the answer. I found on this forum a script for quotes rotating. My script is:

    <script type="text/javascript">
    //<![CDATA[
    var quote=new Array();
    quote[0]='one';
    quote[1]='two';
    quote[2]='three';
    quote[3]='four';
    quote[4]='five';
    var speed=5000;
    var q=0;

    function showQuote() {

    document.getElementById("quotes").firstChild.data=quote[q];
    q++;
    if(q==quote.length) {
    q=0;
    }
    }
    setInterval('showQuote()',speed);

    //]]>
    </script>

    My quotes are in table part TD with id 'quotes', but authors of them are in another TD with id 'authors'. I tried to put two same scripts one after another, but only one works. How can I make one javascript which could be loaded from *.js file, where 'quotes' could be separated with 'authors' for different HTML parts, and would be shown randomly.

    I mean there is a TABLE with two TD's
    like:
    TD1: quotes
    TD2: authors

    Thanks in advance

  14. #59
    boyfly's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2010
    Posts
    1

    Re: Rotating Text/Quotes Script?

    Hi Coothead. Thanks a bunch for sharing your code and knowledge. Your patience is amazing.

    I did have a question, but I thought of one last thing to try before I posted and it worked! So I'm just here to say thank you!!

  15. #60
    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 boyfly,

    no problem, you're very welcome.



Page 4 of 7 First 1 2 3 4 5 6 7 Last

Tags for this Thread