Ajax Text and or Image Rotation
Dec 13, 2010

New customers as of the date of this article will have this text / image rotate function enabled by default. pre existing clients will need add the HTML and JS below to their apps or we can do it for you.

 

You can add new information to the function by:

  1. login to the crm
  2. select configuration from the other menu
  3. select testimonial in the shopping cart area

div id="testimonial"></div


script>
pu =    new Ajax.PeriodicalUpdater('','/ajax/testimonial.php',{
        method: 'post',
        frequency: 7,
        parameters: 'last=',
        evalJSON: 'force',
        onSuccess: function (t){
           
             if(t.responseJSON['next_id']==null)
             {
                 pu.stop();
             } else {            
                 var qstr = 'last='+ t.responseJSON['next_id'];
                 pu.options.parameters = qstr.toQueryParams();
                
   
                 $('testimonial').hide();
                 $('testimonial').update(t.responseJSON['testimonial']);
                 $('testimonial').appear({ duration: 3.0 });
                
                 pu.frequency = t.responseJSON['delay'];
                pu.registerCallback();   
             }
         }
    });


// start and stop the pu

$('testimonial').observe('mouseover',pu_stop);
$('testimonial').observe('mouseout',pu_start);

function pu_start()
{
    pu.start();
}


function pu_stop()
{
    pu.stop();
}


 



Page 1 of 1

create discussion Create Discussion

Privacy Policy