Alternating Message Text Box in iweb

Discussion in 'Web Design and Development' started by ydmusic, Oct 11, 2009.

  1. ydmusic macrumors newbie

    Joined:
    Apr 5, 2007
    #1
    Hi,

    I would like to ask any html/javascript masters out there if they know of a good source code with which I could embed an alternating message text box in my iweb site using the HTML snippet widget.

    I prefer not to have a normal marquee, but rather alternating text, and if possible with customizable color and shape, etc.

    A million thanks!

    ydmusic
     
  2. nfable macrumors regular

    nfable

    Joined:
    Apr 9, 2007
    #2
    What I do

    Best I can offer is the following which can be seen @
    www.MississippiRollerGirls.com/home/html/MSRG/Home.html

    Notice the sponsor window, hit refresh and a new sponsor pops up... I copied this code from I don't know where but it works for this; I'd like a truly random method myself; for instance if someone empties their cache every session, they will see the same image on next visit; I would like someway for it to be on 'shuffle'

    code in snippet
    ____________

    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>

    <noscript><img src="http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/LiquidLounge.png"></noscript>
    <script type="text/javascript">
    function robin(){
    //Set Your Images in the below Array:
    var robin_im=['http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/Moose_Lodge_WEB.jpg', 'http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/HarleyD_WEB.png', 'http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/LiquidLounge_WEB.png', 'http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/Sonic_WEB.png', 'http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/Venues_WEB.png','http://www.mississippirollergirls.com/home/html/MSRG/Sponsor_files/MOWA_WEB.jpg']

    //set the links in the below Array:
    var robin_link=['http://maps.google.com/maps?oe=utf-8&rls=org.mozilla:en-US:eek:fficial&client=firefox-a&um=1&ie=UTF-8&q=5145+west+gay+d%27iberville,+ms&fb=1&split=1&gl=us&view=text&latlng=411836207323197233', 'http://www.coastharley.com', 'http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendID=125661409', 'http://www.google.com/search?client=safari&rls=en-us&q=sonic+ocean+springs,+ms&ie=UTF-8&oe=UTF-8', 'http://www.google.com/search?hl=en&client=safari&rls=en-us&q=venues+biloxi%2C+ms&btnG=Search','http://maps.google.com/maps?hl=en&client=firefox-a&ie=UTF8&q=mowa+development+gautier,+ms&fb=1&split=1&gl=us&view=map&ei=INj7Sdy6IovWM8eKpFw&cd=1']

    //////////////// Stop Editing //////////////////
    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }

    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca;
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }

    function eraseCookie(name) {
    createCookie(name,"",-1);
    }
    var num=readCookie('robim')? readCookie('robim')*1 : 0;
    document.write('<a href="'+robin_link[num]+'"><img src="'+robin_im[num]+'"></a>')
    num=num<robin_im.length-1? num+1 : 0;
    createCookie('robim', num);
    }
    robin();
    </script>

    </body>
    </html>

    _________________
    end of snippet

    good luck
     

Share This Page