onMouseOver after 300 msec. How to do it?
onMouseOver after 300 msec. How to do it?
Hi,
I use datatables with server_processing with numericComma with ColumnFilter with FixedHeader and scroller.
I would hope that the passage of a mouse line carries 300 milliseconds after a function. but I can not!
This will prevent this function is executed 10 times, if I pass very quickly with the mouse over 10 lines of the table...
In fact, I would like to start this function "search ()" only after 300 msec of inactivity of the mouse ...
Can you help me?
Below is the code in question (oTable + function onMouseOver)
Thank you in advance for your help.
Cordially.
[code]
$(document).ready(function() {
url();
var oTable = $('#example').dataTable( {
"bDestroy": true,
"sScrollY": example,
"bFilter": false,
"bInfo": false,
"bScrollCollapse": true,
"BJQueryUI" : false,
"aoColumns": [
{ "sTitle": "comparer", "bSortable": false,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "forme", "bSortable": true,
"sClass": "alignLeft", "bVisible": true },
{ "sTitle": "carat", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "taille", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "couleur", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "pureté", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "poli", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[11]==1)?true:false },
{ "sTitle": "sym", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[12]==1)?true:false },
{ "sTitle": "prof", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[13]==1)?true:false },
{ "sTitle": "table", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[14]==1)?true:false },
{ "sTitle": "fluo", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[15]==1)?true:false },
{ "sTitle": "prix/ct", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[16]==1)?true:false },
{ "sTitle": "colette", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[17]==1)?true:false },
{ "sTitle": "Lg/lg", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[18]==1)?true:false },
{ "sTitle": "délai", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "certificat", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "prix", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "détail", "bSortable": false,
"sClass": "alignLeft", "bVisible": true }
],
"sAjaxSource": "js/dt/chargementdata00.php" + argurl,
"bDeferRender": true,
"bServerSide": true,
"sDom": "frtiS",
"oScroller": {
"loadingIndicator": true
},
"oLanguage": {
"sLoadingRecords": "Chargement en cours...",
"sZeroRecords": "Aucun diamant n'a pu être trouvé !"
},
"sScrollX": "100%",
"sScrollXInner": coef,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "more_data", "value": "my_value" } );
$.getJSON( sSource, aoData, function (json) {
maxref = json.iTotalRecords;
triref = json.iTotalDisplayRecords;
nbreference();
fnCallback(json)
} );
},
"aaSorting": [[ 16, "asc" ]]
} );
} );
$('#example tbody tr').live('mouseover', function () {
this.style.cursor='pointer';
colour = this.style.backgroundColor + '';
this.style.backgroundColor = '#EFE4EA';
this.style.color = '#9F3082';
var nTds = $('td', this);
sref = $(nTds[0]).children(0).attr('id');
sref = sref.substr(3);
search (sref);
} );
$('#example tbody tr').live('mouseout', function () {
this.style.backgroundColor = colour;
this.style.color = '#666666';
} );
[/code]
I use datatables with server_processing with numericComma with ColumnFilter with FixedHeader and scroller.
I would hope that the passage of a mouse line carries 300 milliseconds after a function. but I can not!
This will prevent this function is executed 10 times, if I pass very quickly with the mouse over 10 lines of the table...
In fact, I would like to start this function "search ()" only after 300 msec of inactivity of the mouse ...
Can you help me?
Below is the code in question (oTable + function onMouseOver)
Thank you in advance for your help.
Cordially.
[code]
$(document).ready(function() {
url();
var oTable = $('#example').dataTable( {
"bDestroy": true,
"sScrollY": example,
"bFilter": false,
"bInfo": false,
"bScrollCollapse": true,
"BJQueryUI" : false,
"aoColumns": [
{ "sTitle": "comparer", "bSortable": false,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "forme", "bSortable": true,
"sClass": "alignLeft", "bVisible": true },
{ "sTitle": "carat", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "taille", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "couleur", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "pureté", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "poli", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[11]==1)?true:false },
{ "sTitle": "sym", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[12]==1)?true:false },
{ "sTitle": "prof", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[13]==1)?true:false },
{ "sTitle": "table", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[14]==1)?true:false },
{ "sTitle": "fluo", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[15]==1)?true:false },
{ "sTitle": "prix/ct", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[16]==1)?true:false },
{ "sTitle": "colette", "bSortable": true,
"sClass": "alignCenter", "bVisible": (swColonne[17]==1)?true:false },
{ "sTitle": "Lg/lg", "bSortable": true,
"sClass": "alignRight", "bVisible": (swColonne[18]==1)?true:false },
{ "sTitle": "délai", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "certificat", "bSortable": true,
"sClass": "alignCenter", "bVisible": true },
{ "sTitle": "prix", "bSortable": true,
"sClass": "alignRight", "bVisible": true },
{ "sTitle": "détail", "bSortable": false,
"sClass": "alignLeft", "bVisible": true }
],
"sAjaxSource": "js/dt/chargementdata00.php" + argurl,
"bDeferRender": true,
"bServerSide": true,
"sDom": "frtiS",
"oScroller": {
"loadingIndicator": true
},
"oLanguage": {
"sLoadingRecords": "Chargement en cours...",
"sZeroRecords": "Aucun diamant n'a pu être trouvé !"
},
"sScrollX": "100%",
"sScrollXInner": coef,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "more_data", "value": "my_value" } );
$.getJSON( sSource, aoData, function (json) {
maxref = json.iTotalRecords;
triref = json.iTotalDisplayRecords;
nbreference();
fnCallback(json)
} );
},
"aaSorting": [[ 16, "asc" ]]
} );
} );
$('#example tbody tr').live('mouseover', function () {
this.style.cursor='pointer';
colour = this.style.backgroundColor + '';
this.style.backgroundColor = '#EFE4EA';
this.style.color = '#9F3082';
var nTds = $('td', this);
sref = $(nTds[0]).children(0).attr('id');
sref = sref.substr(3);
search (sref);
} );
$('#example tbody tr').live('mouseout', function () {
this.style.backgroundColor = colour;
this.style.color = '#666666';
} );
[/code]
This discussion has been closed.