I am trying to modify some existing code and can't get it working correctly. When the mouse is over div id "mine" I need the setinterval to stop and when the mouse is not over the div for the set interval to resume. I've tried and tried all day and night to get this working and just don't seem to be able to do it. Any help would be greatly appreciated. Thank you.
jQuery(document).ready(function(){
// check all
jQuery(this).on('click', '#selectall', function() {
jQuery('.checkbox').prop('checked', jQuery(this).is(":checked"));
});
// ajax
jQuery(this).on('submit', 'form[name="dispatchform"]', function(){
jQuery.ajax({
url: jQuery(this).attr('action'),
data: jQuery(this).serialize(),
type: 'post',
beforeSend: function(){jQuery('body').css('opacity', '0.5');},
success: function(data) {
var response = jQuery(data).find('#dispatchTable').html();
jQuery('#dispatchTable').html(response);
//message
var msg = jQuery(data).find('td.messageStackError, td.messageStackSuccess').html();
jQuery('#msg').css({
'padding': '10px',
'text-align': 'center',
'font-size': '12px',
'background-color': 'darkkhaki',
'margin': '10px 0',
'color': '#fff'
}).html(msg);
},
complete: function(){jQuery('body').css('opacity', '1');}
});
return false;
});
setInterval(function() {
jQuery.ajax({
url: jQuery(this).attr('action'),
data: jQuery(this).serialize(),
type: 'post',
beforeSend: function(){jQuery('body').css('opacity', '0.5');},
success: function(data) {
var response = jQuery(data).find('#dispatchTable').html();
jQuery('#dispatchTable').html(response);
//message
var msg = jQuery(data).find('td.messageStackError, td.messageStackSuccess').html();
if(msg !== undefined) {
jQuery('#msg').css({
'padding': '10px',
'text-align': 'center',
'font-size': '12px',
'background-color': 'darkkhaki',
'margin': '10px 0',
'color': '#fff'
}).html(msg);
}
},
complete: function(){jQuery('body').css('opacity', '1');}
});
}, 15000);
});
no update area