Jquery Gritter设定位置

Mar*_*sen 2 javascript jquery gritter

是否有可能改变gritter?或者甚至更好地将它绑定到诸如span或div之类的元素?

我试过了:

        $.gritter.add({
            title: 'Dashboard',
            text: 'Field updated!',
            time: 2000,
            position: 'center'
       });
Run Code Online (Sandbox Code Playgroud)

(也尝试过buttom,top等)但位置保持不变

小智 11

通过阅读文档,似乎你不能像这样把焦点集中在一起,只有'左下','右下','左上','右上'

$.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...
});
Run Code Online (Sandbox Code Playgroud)

如果你用css改变位置怎么办?