32 users online (1 members and 31 guests)  


Page 3 of 7 First 1 2 3 4 5 6 7 Last
  Results 31 to 45 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. #31
    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 drose,

    that script loads a "quote" onload and on page refresh, nothing more.

    Is that what you really want?

  2. #32
    drose's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    7

    Re: Rotating Text/Quotes Script?

    This one:

    <style type="text/css">
    /*<![CDATA[*/


    #quotes {
    position:relative;
    padding:10px;
    font-family:Georgia,Times,serif;
    font-style:italic;
    font-size:14px;
    color:#ce6f0a;
    width:282px;
    height:260px;
    border:solid 0px #000000;
    background-color:#ffffff;
    text-align:left;
    }

    /*//]]>*/
    </style>

    <script type="text/javascript">
    //<![CDATA[
    var quote=new Array();
    quote[0]='quote one goes here';
    quote[1]='quote two goes here';
    quote[2]='quote three goes here';

    var speed=3500; /*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>

    Thanks for the great responses, quick!

  3. #33
    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 drose,

    I think that you, probably want it like this...
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title></title>
    
    <style type="text/css">
    #quote {
        position:relative;
        width:282px;
        padding:10px;
        font-family:georgia,times,serif;
        font-style:italic;
        font-size:14px;
        color:#ce6f0a;
        border:0 solid #000;
        background-color:#fff;
        text-align:left;
     }
    </style>
    
    <script type="text/javascript">
    
      var speed=3000;    /*this is the time in milliseconds adjust to suit*/
      var c=0;
    
    function showQuote() {
       quotes=[
             'This is quote number one',    /* add as many quotes as you like!*/
             'This is quote number two',
             'This is quote number three',
             'This is quote number four',
             'This is quote number five',
             'This is quote number six',
             'This is quote number seven',
             'This is quote number eight',
             'This is quote number nine',
             'This is quote number ten'
             ];
       c++;
    if(c==quotes.length) {
       c=0;
     }
       document.getElementById('quote').firstChild.nodeValue=quotes[c];
    
       setTimeout(function(){showQuote()},speed);
     }
    
    if(window.addEventListener){
       window.addEventListener('load',function(){setTimeout(function(){showQuote()},speed)},false);
     }
    else { 
    if(window.attachEvent){
       window.attachEvent('onload',function(){setTimeout(function(){showQuote()},speed)});
      }
     }
    </script>
    
    </head>
    <body>
    
    <div id="quote">This is quote number one</div>
    
    </body>
    </html>
    

  4. #34
    drose's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    7

    Re: Rotating Text/Quotes Script?

    I appreciate your help! The response time is incredible!

    Here's what I have, so far it is not working:

    <style type="text/css">
    #quotes {
    position:relative;
    padding:10px;
    font-family:Georgia,Times,serif;
    font-style:italic;
    font-size:14px;
    color:#ce6f0a;
    width:282px;
    border:solid 0px #000000;
    background-color:#ffffff;
    text-align:left;
    }
    </style>

    <script type="text/javascript">

    var speed=3000; /*this is the time in milliseconds adjust to suit*/
    var c=0;

    function showQuote() {
    quotes=[
    '&#39;&#39;Public relations has changed dramatically over the last five years, and TEST has proven to us the value of both traditional and social media in communicating to the market. Regardless of the vehicle, PR firms must be able to provide on-going, compelling information about their clients. *As an analyst, I was impressed by TEST&#39;s skill at doing this and now as a client, I am benefiting from their ability to gain greater visibility for our company&#39;s services and events.&#39;&#39;<br /><br />-John Doe',
    '&#39;&#39;TEST truly understands the media and works to deliver what we need, when we need it. I consider them a premier PR agency for high tech companies and donít hesitate to connect with them for stories, blogs, or general industry updates.&#39;&#39;<br /><br />-John Doe',
    '&#39;&#39;Itís important for PR firms to understand not just the technology but the market dynamics. I have worked with TEST over the years and they understand who my readers are and what information is important to them, bringing the right blend of technical detail and market expertise.&#39;&#39;<br /><br />-John Doe'
    ];
    c++;
    if(c==quotes.length) {
    c=0;
    }
    document.getElementById('quote').firstChild.nodeValue=quotes[c];

    setTimeout(function(){showQuote()},speed);
    }

    if(window.addEventListener){
    window.addEventListener('load',function(){setTimeout(function(){showQuote()},speed)},false);
    }
    else {
    if(window.attachEvent){
    window.attachEvent('onload',function(){setTimeout(function(){showQuote()},speed)});
    }
    }
    </script>


    <body>

    <div id="quote"></div>

  5. #35
    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 drose,

    The problem is that you have introduced HTML into the "quotes", amongst other errors.
    Here is the amended code that now meets your new requirements...
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    
    <title></title>
    
    <style type="text/css">
    #quote {
        position:relative;
        width:282px;
        height:260px;
        padding:20px 10px;
        border: 1px solid #ce6f0a;
        font-family:georgia,times,serif;
     }
    #text {
        margin:0 0 20px;
        font-style:italic;
        font-size:14px;
        color:#ce6f0a;
     }
    #name {
        font-family:verdana,arial,helvetica,sans-serif;
        font-size:12px;
        font-weight:bold;
        color:#cb6c07;
     }
    </style>
    
    <script type="text/javascript">
    
      var speed=10000;    /*this is the time in milliseconds adjust to suit*/
      var c=0;
    
    function showQuote() {
    
       quotes=[
    
    '<p id="text">"Public relations has changed dramatically over the last five years, and TEST has proven to us the '+ 
    'value of both traditional and social media in communicating to the market. Regardless of the vehicle,'+ 
    'PR firms must be able to provide on-going, compelling information about their clients. *As an analyst,'+ 
    'I was impressed by TEST\'s skill at doing this and now as a client, I am benefiting from their ability '+
    'to gain greater visibility for our company\'s services and events."<\/p><p id="name">- John Doe<\/p>',
        
    '<p id="text">"TEST truly understands the media and works to deliver what we need, when we need it. I consider them '+ 
    'a premier PR agency for high-tech companies and don\'t hesitate to connect with them for stories, blogs, '+ 
    'or general industry updates."<\/p><p id="name">- John Doe<\/p>',
    
    '<p id="text">"It\'s important for PR firms to understand not just the technology but the market dynamics. I have '+ 
    'worked with TEST over the years and they understand who my readers are and what information is important '+ 
    'to them, bringing the right blend of technical detail and market expertise."<\/p><p id="name">- John Doe<\/p>'
    
             ];
    
       c++;
    if(c==quotes.length) {
       c=0;
     }
       document.getElementById('quote').innerHTML=quotes[c];
    
       setTimeout(function(){showQuote()},speed);
     }
    
    if(window.addEventListener){
       window.addEventListener('load',function(){setTimeout(function(){showQuote()},speed)},false);
     }
    else { 
    if(window.attachEvent){
       window.attachEvent('onload',function(){setTimeout(function(){showQuote()},speed)});
      }
     }
    
    </script>
    
    </head>
    <body>
    
    <div id="quote">
    
    <p id="text">
    "Public relations has changed dramatically over the last five years, and TEST has proven to us the 
    value of both traditional and social media in communicating to the market. Regardless of the vehicle, 
    PR firms must be able to provide on-going, compelling information about their clients. *As an analyst, 
    I was impressed by TEST's skill at doing this and now as a client, I am benefiting from their ability 
    to gain greater visibility for our company's services and events."
    </p>
    
    <p id="name">- John Doe</p>
    
    </div>
    
    </body>
    </html>
    
    If you are going to add similar "quotes", take care with their formulation.
    Note that I have allowed for separate styling to the "quotes" and the "author".
    Of course, we are always here if you experience problems with this.

  6. #36
    drose's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    7

    Re: Rotating Text/Quotes Script?

    Ok, I think I did what you said, but it doesn't work, I think it didn't copy correctly:

    <style type="text/css">
    #quote {
    ***position:relative;
    ***width:282px;
    ***height:260px;
    ***padding:20px 10px;
    ***border: 1px solid #ce6f0a;
    ***font-family:georgia,times,serif;
    }
    #text {
    ***margin:0 0 20px;
    ***font-style:italic;
    ***font-size:14px;
    ***color:#ce6f0a;
    }
    #name {
    ***font-family:verdana,arial,helvetica,sans-serif;
    ***font-size:12px;
    ***font-weight:bold;
    ***color:#cb6c07;
    }
    </style>

    <script type="text/javascript">

    *var speed=3000; ***/*this is the time in milliseconds adjust to suit*/
    *var c=0;

    function showQuote() {

    **quotes=[

    '<p id="text">"Public relations has changed dramatically over the last five years, and TEST has proven to us the '+
    'value of both traditional and social media in communicating to the market. Regardless of the vehicle,'+
    'PR firms must be able to provide on-going, compelling information about their clients. *As an analyst,'+
    'I was impressed by TEST\'s skill at doing this and now as a client, I am benefiting from their ability '+
    'to gain greater visibility for our company\'s services and events."<\/p><p id="name">- John Doe<\/p>',

    '<p id="text">"TEST truly understands the media and works to deliver what we need, when we need it. I consider them '+
    'a premier PR agency for high-tech companies and don\'t hesitate to connect with them for stories, blogs, '+
    'or general industry updates."<\/p><p id="name">- John Doe<\/p>',

    '<p id="text">"It\'s important for PR firms to understand not just the technology but the market dynamics. I have '+
    'worked with TEST over the years and they understand who my readers are and what information is important '+
    'to them, bringing the right blend of technical detail and market expertise."<\/p><p id="name">- John Doe<\/p>'

    ];

    ********];

    **c++;
    if(c==quotes.length) {
    **c=0;
    }
    **document.getElementById('quote').innerHTML=quotes[c];

    **setTimeout(function(){showQuote()},speed);
    }

    if(window.addEventListener){
    **window.addEventListener('load',function(){setTimeout(function(){showQuote()},speed)},false);
    }
    else {
    if(window.attachEvent){
    **window.attachEvent('onload',function(){setTimeout(function(){showQuote()},speed)});
    *}
    }

    </script>


    <div id="quotes">

    <p id="text">
    "Public relations has changed dramatically over the last five years, and TEST has proven to us the value of both traditional and social media in communicating to the market. Regardless of the vehicle, PR firms must be able to provide on-going, compelling information about their clients. As an analyst, I was impressed by TEST's skill at doing this and now as a client, I am benefiting from their ability to gain greater visibility for our company's services and events."
    </p>

    <p id="name">- John Doe</p>

    </div>


    id="quotes" I tried quotes and quote here.

  7. #37
    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 drose,

    you seem to be having trouble with Copy & Pasting and File Saving.

    In case I am unable to help you with your dilemma I have attached a zip file for your use.
    Just download and open it and you will find everything - (in working order) - that you need.

    Here is a method that may help you solve your problem...
    1. Open NotePad.
    2. Copy & Paste the code into NotePad.
    3. How to Copy & Paste

      1. With your mouse, place cursor at the beginning of the code in the textarea.
      2. Hold the left-mouse down and then drag the mouse down to the bottom of the textarea.
      3. This has the effect of highlighting the code.
      4. Release the left-mouse.
      5. Right-mouse click will bring up a small dialog box.
      6. Scroll down the dialog box and click Copy.
      7. With your mouse, place cursor over NotePad.
      8. Right-mouse click will bring up a small dialog box.
      9. Scroll down the dialog box and click Paste.
    4. Click File.
    5. Click Save As....
    6. This will bring up a dialog box similar to the image at this link...

    7. Type in the file name with the extension .html.
    8. Select the desired 'Directory' in Save in: .
    9. Click Save.
    10. Go to your selected 'Directory' to test your file.
    11. Double clicking the some_name.html file will open it in your default browser
    12. Finally have a beer.
    Attached Files Attached Files

  8. #38
    drose's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    7

    Re: Rotating Text/Quotes Script?

    Coothead,

    Thanks for the copy/paste lesson! I finally got the code to work! Thanks so much for sticking with me! I appreciate it.

    Best to you,

    DR

  9. #39
    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.

  10. #40
    Yerl's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    9

    Re: Rotating Text/Quotes Script?

    Thx was looking for something like this for my new website.

  11. #41
    Yerl's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    9

    Re: Rotating Text/Quotes Script?

    Hello Coothead, thx for this great script

    But i am having a bit of a problem. Is there any way of randomizing the quotes so that a different one comes up other then 1 2 3 maybe 3 8 1. Here is the script you made that im using:

    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:#fff;
       }
    #quotes {
         position:absolute;
         left:50%;
         top:50%;
         margin:-50px 0 0 -81px;
         padding:20px;
         font-family:arial;
         font-size:26px;
         color:#000000;
         width:250px;
         height:100px;
         background-color:#ffffff;
         text-align:center;
       }
       #qname {
         padding:0px;
         font-family:arial;
         font-size:12px;
         color:#000000;
         background-color:#ffffff;
         text-align:right;
       }
     
    /*//]]>*/
    </style>
        
    <script type="text/javascript">
    //<![CDATA[
    var quote=new Array();
      quote[0]='This is quote number one<br /><div id="qname">-Ufocomet</div>';    /* add as many quotes as you like!*/
      quote[1]='This is quote number two<br /><div id="qname">-Ufocomet</div>';
      quote[2]='This is quote number three<br /><div id="qname">-Ufocomet</div>';
      quote[3]='This is quote number four<br /><div id="qname">-Ufocomet</div>';
      quote[4]='This is quote number five<br /><div id="qname">-Ufocomet</div>';
      quote[5]='This is quote number six<br /><div id="qname">-Ufocomet</div>';
      quote[6]='This is quote number seven<br /><div id="qname">-Ufocomet</div>';
      quote[7]='This is quote number eight<br /><div id="qname">-Ufocomet</div>';
      quote[8]='This is quote number nine<br /><div id="qname">-Ufocomet</div>';
      quote[9]='This is quote number ten<br /><div id="qname">-Ufocomet</div>';
    
    var speed=4000;    /*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">This is quote number start<br /><div id="qname">-Ufocomet</div></div>
    
    </body>
    </html>

  12. #42
    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,

    do you want them randomized?

  13. #43
    Yerl's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    9

    Re: Rotating Text/Quotes Script?

    Yes please

  14. #44
    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,

    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>
    

  15. #45
    Yerl's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2009
    Posts
    9

    Re: Rotating Text/Quotes Script?

    Thx coothead, but i have encountered a problem. It works fine in firefox but when i stick the code into my joomla template it starts to rotate very fast (very fast). I tryed changing the var timer=4*1000; to different figures but it didn't work. It must be something on joomla's side i think. I would show you an example but i havent yet uploaded my site. Im building it off line.



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

Tags for this Thread