Alternating Message Text Box in iweb

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

  1. ydmusic macrumors newbie

    Apr 5, 2007

    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!

  2. nfable macrumors regular


    Apr 9, 2007
    What I do

    Best I can offer is the following which can be seen @

    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

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

    <noscript><img src=""></noscript>
    <script type="text/javascript">
    function robin(){
    //Set Your Images in the below Array:
    var robin_im=['', '', '', '', '','']

    //set the links in the below Array:
    var robin_link=[',+ms&fb=1&split=1&gl=us&view=text&latlng=411836207323197233', '', '', ',+ms&ie=UTF-8&oe=UTF-8', '',',+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();
    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) {
    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);


    end of snippet

    good luck

Share This Page