此代码仅在刷新时有效,但是我希望它能实时运行
add_action( 'wp_footer', 'conditionally_hid' );
function conditionally_hid(){
jQuery(function($){
$("#customer_login").each(function() {
if ($(this).css("display") == "none") {
// handle non visible state
$('.steps').insertAfter( $('.actions') );
} else {
// handle visible state
$('.actions').insertAfter( $('.steps') );
}
});
});
}