var deliveryDateHelpText = "Please select the date you would like your order to be delivered."; var deliverySuburbHelpText = "Please select the suburb you would like your order delivered to."; if (Drupal.jsEnabled) { $(document).ready(function() { // find the delivery_date field //$("#edit-delivery-date-datepicker-popup-0").val("Delivery Date"); // find the delivery_date_help link /*var delivery_date_help = $("a.delivery_date_help").click(function() { $("div.help_info").html(deliveryDateHelpText); $("html").click(function() { clearHelpInfoDiv(); }); return false; });*/ // find the delivery_suburb_help link /*var delivery_suburb_help = $("a.delivery_suburb_help").click(function() { $("div.help_info").html(deliverySuburbHelpText); $("html").click(function() { clearHelpInfoDiv(); }); return false; });*/ /*HELP TEXT $("#delivery_suburb .jquery_dropdown_header").mouseover(function(){ $("div.help_info").html(deliverySuburbHelpText); }).mouseout(function(){ clearHelpInfoDiv(); }).click(function(){ clearHelpInfoDiv(); }); $("#edit-delivery-date").mouseover(function(){ $("div.help_info").html(deliveryDateHelpText); }).mouseout(function(){ clearHelpInfoDiv(); }).click(function(){ clearHelpInfoDiv(); });*/ //clear validations messages when user changes a form element $("#delivery_date :input").change(function() { clearHelpInfoDiv(); }); //when clicking another suburb $("#delivery_suburb .edit-delivery-suburb").click(function() { clearHelpInfoDiv(); }); //start the image fade rotation /*$('#all_product_images-list .views-row-'+$("#irot").children('li').length+' img').load(function(){ showNextImage(1,$("#irot").children('li').length+1,0); });*/ }); } function showNextImage(container_id,target_id,limit) { //so it doesnt go for ever //if(limit<300) //{ total_images = $("#all_product_images-list").children('li').length; total_slots = $("#irot").children('li').length; var container = $('#irot-'+container_id+' img'); var target = $('#all_product_images-list .views-row-'+target_id+' img'); container.fadeOut("fast",function(){ container.attr("src", target.attr("src")); container.fadeIn("slow"); }); container_id = container_id%total_slots; target_id = target_id%total_images; //after % because it starts at 1 container_id++; target_id++; limit++; setTimeout( (function(){showNextImage(container_id,target_id,limit);}),1000 ); //} } function fader(image,index) { console.log($(image+"_"+index)); /*$(image+"_"+index).load(function () { $(this).fadeIn('slow', function() { //fade in "slow" $(this).animate({opacity: 1.0}, 3000, function() { //stay there for 3 seconds $(this).fadeOut('slow',function() { //then fade out "slow" fader(image,index+1); //then fade in the next image in line }); }); }); });*/ } function clearHelpInfoDiv() { // remove the text from the help info div $("div.help_info").html(" "); // remove the need to call this function on every mouse click $("body").click(function() { // nothing }); }