简体   繁体   English

在左下方对齐引导程序警报

[英]Align a bootstrap-growl alert bottom left

According to the bootstrap-growl options documentation we can use placement options to stick the growl notifications elsewhere. 根据bootstrap-growl选项文档,我们可以使用placement选项将咆哮声通知贴在其他地方。 I'm trying to put my growl notifications bottom left , but it's not working. 我正在尝试将咆哮通知放在左下角 ,但它不起作用。

Here's what I'm trying to do: 这是我想做的事情:

 $(document).ready(function () { $.growl({ message: 'Test.' }, { placement: { from: "bottom", align: "left" }, delay: 1000000 }); }); 
 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-growl/1.0.6/bootstrap-growl.min.js"></script> 

The options are being parsed it seems: the delay option is honored. 该方案正在分析看来:在delay选项荣幸。 So are others if I add them. 如果我添加其他人,也是如此。 However, the placement remains at its default top/right position. 但是,该放置位置仍保持其默认的顶部/右侧位置。

I'm using bootstrap-growl version 1.0.6. 我正在使用bootstrap-growl版本1.0.6。 Version 2 seems to be in the making but not released yet. 版本2似乎正在制作中,但尚未发布。 Perhaps part of my problem is that the bootstrap-growl website's documentation is aimed at V2? 也许我的问题的一部分是bootstrap-growl网站的文档针对的是V2?

What am I missing here? 我在这里想念什么? Probably something obvious... 可能很明显...

Use position instead, like this: 改为使用position ,如下所示:

 $(document).ready(function () { $.growl({ message: 'Test.' }, { position: { from: "bottom", align: "left" }, delay: 1000000 }); }); 
 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-growl/1.0.6/bootstrap-growl.min.js"></script> 

If you check the 1.0.6 release's options documentation on GitHub you'll see that the relevant option is not (yet) called " placement " but (still) called " position ". 如果您检查在GitHub上发布1.0.6的选项文件 ,你会看到相关选项(还)没有所谓的“ placement ”,但(仍)称为“ position ”。 Some other options seem to be different too. 其他一些选项似乎也有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM