是否可以改变gritter
的位置?或者更好地将其绑定(bind)到诸如 span 或 div 之类的元素?
我尝试过:
$.gritter.add({
title: 'Dashboard',
text: 'Field updated!',
time: 2000,
position: 'center'
});
(也尝试过按钮、顶部等)但位置保持不变
最佳答案
通过阅读文档,似乎你不能像这样将 gritter 居中,只能是“左下”、“右下”、“左上”、“右上”
$.extend($.gritter.options, {
position: 'bottom-left', // defaults to 'top-right' but can be 'bottom-left', 'bottom-right', 'top-left', 'top-right' (added in 1.7.1)
fade_in_speed: 'medium', // how fast notifications fade in (string or int)
fade_out_speed: 2000, // how fast the notices fade out
time: 6000 // hang on the screen for...
});
如果用css改变位置会怎样?
关于javascript - Jquery Gritter 设置位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18461530/