我喜欢这个 jquery 脚本在页面加载时加载,而不是在单击时加载。 我更改了以下内容:
<script>
$('.error').on('click', function(){
$(this).notifyMe(
'bottom', // Position
'error', // Type
'Lorem Ipsum Text', // Title
'Lorem Ipsum is simply dummy text of the printing', // Description
200 // Velocity of notification
2000 // (optional) Time of delay to close automatically
);
});
</script>
至:
<script>
$(document).ready(function() {
$(this).notifyMe(
'bottom', // Position
'error', // Type
'Lorem Ipsum Text', // Title
'Lorem Ipsum is simply dummy text of the printing', // Description
200 // Velocity of notification
2000 // (optional) Time of delay to close automatically
);
});
</script>
但它不会加载通知程序。 它基于以下脚本:http://www.jqueryrain.com/?koLHvt8W
有人可以告诉我我做错了什么吗?
最佳答案
应该是:
$(document).ready(function () {
$('.error').notifyMe(
'bottom', // Position
'error', // Type
'Lorem Ipsum Text', // Title
'Lorem Ipsum is simply dummy text of the printing', // Description
200 // Velocity of notification
2000 // (optional) Time of delay to close automatically
);
});
关于Jquery 在页面加载时而不是 onclick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27570458/