我这里有一长串 jquery 幻灯片函数:
不同的 ID 但相同的行为。
代码:
/*DataTables*/
$(document).ready( function() {
$('#all-active-users').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#all-deactivated-users').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#all-ppmps').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#agency-users').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#all-ppmps-by-agency').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#ppmp-form').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#all-agencies').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#ppmp-uploaded-files').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
$(document).ready( function() {
$('#agency-types').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
我想知道的是如何使它简短而准确。
我尝试了这样的事情,但没有运气:
$(document).ready( function() {
$('#all-active-users').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
$('#all-deactivated-users').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers"
} );
} );
每当我试图缩短代码时,代码就失效了。
任何解决方法将不胜感激。谢谢。