Activity Stream
48,167 MEMBERS
6906 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 10 of 10
  1.     
    #1
    Member
    Website's:
    YourVPNList.blinkweb.com

    Question How to make an Auto changing text with link via html??

    How to make an Auto changing text with link via html??

    I need to know what code i must use to make a TEXT with links changing by timer or even by page reload so each time the user move from page to page the text changes.

    the text will be with links to another pages on same site or even to outside from it it looks like this:

    free games ( as first text for exa )
    hot offers ( as second text for exa)
    ... and so on

    so the user will see more than one text while he reading or looking at my site

    Thanks
    myincome2020 Reviewed by myincome2020 on . How to make an Auto changing text with link via html?? How to make an Auto changing text with link via html?? I need to know what code i must use to make a TEXT with links changing by timer or even by page reload so each time the user move from page to page the text changes. the text will be with links to another pages on same site or even to outside from it it looks like this: free games ( as first text for exa ) hot offers ( as second text for exa) ... and so on Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Example through PHP:
    PHP Code: 
    <?php

    $text 
    = array(
    'My first text',
    'rotating',
    'on each page reload',
    '......',
    'so on.');
     
    $randomIndex rand(0count($text) - 1);
    echo 
    "$text[$randomIndex]";

    ?>

  4.     
    #3
    Member
    Website's:
    YourVPNList.blinkweb.com
    Thanks Bro for help

    But what about link for each text?
    what about timer option?
    some details about this code what i can change or use inside it?

    thanks so much

  5.     
    #4
    Member
    Website's:
    sborg.us
    PHP Code: 
    <?php

    $text 
    = array(
    'My first text' => 'http://mylink1/'
    'rotating' => 'http://mylink2/'
    'on each page reload' => 'http://mylink3/'
    );

    $random array_rand($text); 
    echo 
    "<a href=\"$random\">$text[$random]</a>";

    ?>
    That'll take care of your link for each text. There are endless possibilities, you could use a database instead of the pre-defined array.

    As far as timer is concerned, check out jQuery based link rotators - I guess that's what you're looking for.

    V3g3ta | Halcyon | Abhi

  6.     
    #5
    Member
    Website's:
    YourVPNList.blinkweb.com
    Thanks so much for help
    so for timer i need to use another code than html or php?!
    can u help me in one please?

    best regards

  7.     
    #6
    Respected Developer
    demo: http://jsfiddle.net/3p87Z/

    PHP Code: 
    <html xmlns="http://www.w3.org/1999/xhtml">
      <
    head>
        <
    title>Change Text</title>
        <
    script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript">
        $(document).ready(function() {
            // this shit done by mRAza
            // setting current element
            var current = 0;
            // starting interval for 2 seconds
            setInterval(changeText, 2000);
            
            function changeText(){
            // links array with text to tdisplay
            var links =  [      
                                {"text" : "google site",  "link" : 'http://google.com' },
                                {"text" : "yahoo web",  "link" : 'http://yahoo.com'},
                                {"text" : "KWWHunction ftw",  "link" : 'http://besthostingforums.com'}
                        ]
                    // lets check if total arrays are reached so we start from first element    
                    if(links.length == current){
                        current = 0;
                    }
                    // change the text
                    setTimeout(function() {
                        $("#demo").text(links[current]['text']).attr('href', links[current]['link']);
                        current++;
                     }, 1900);
            }
        });
        </script>
      </head>
     <body>
        <div><a  id="demo" href="http://google.com">google</a></div>
     </body>
     
     </html> 
    Bots Development | Web Development | Wordpress Customization | PSD Conversion

    Life has many twists and turns in it, you have to take what you are given and use it for the best.

  8.     
    #7
    Member
    Website's:
    YourVPNList.blinkweb.com
    Thanks Bro for your help and thanks for all who share the ideas here

    this is what i want

    Best Regards

  9.     
    #8
    Respected Developer
    yes but remember next time I might not help you if I dont see any code from your side, First always try to do it and when you cant do it yourself then post thread with your code....that's way you will learn....goodluck
    Bots Development | Web Development | Wordpress Customization | PSD Conversion

    Life has many twists and turns in it, you have to take what you are given and use it for the best.

  10.     
    #9
    Member
    Website's:
    YourVPNList.blinkweb.com
    Thanks I will do for sure

    Best Wishes for All

  11.     
    #10
    Member
    Website's:
    YourVPNList.blinkweb.com
    i try to put this code with my wanted links on Joomla html modul but it does not work only show first text and not change by itself

    anything i have to make?
    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Make new page ( auto ) HTML
    By r00ts in forum Webmaster Discussion
    Replies: 2
    Last Post: 14th Feb 2012, 03:23 PM
  2. Help changing text on the image
    By MediaStar in forum Graphics Area
    Replies: 3
    Last Post: 20th Jan 2012, 04:34 PM
  3. Replies: 54
    Last Post: 15th Dec 2011, 11:36 PM
  4. Changing post text size
    By saini in forum vBulletin
    Replies: 2
    Last Post: 25th Oct 2011, 11:24 AM
  5. [HTML] Text Formatting
    By Rapid S in forum Web Development Area
    Replies: 2
    Last Post: 15th Jun 2010, 02:12 PM

Tags for this Thread

BE SOCIAL