开发者

jquery jrowl size

How to set the jgrowl size to be as auto.Because if the the contents are more i thinks it wraps up the content. can we set this som开发者_JAVA技巧ething like

<script>
$.jGrowl.defaults.size = 'auto';
</script>

Thanks.


There does not appear to be any public methods for setting the width of the growl itself. Your best option may be to go into the css file itself, and change it from ~235px to something larger. Note that this isn't really solving a problem. In reality, causing long text to wrap is (generally speaking) the ideal behavior.

You may also be able to add some logic to the beforeOpen() method that estimates the width of an unwrapped child, and adjusts the width of that particular growl.


I have done this using the beforeOpen callback as follows:

$.jGrowl( "your message here", {
      life: 3000,
      easing: "swing",
      position: 'bottom-left',
      beforeOpen: function(e,m,o){
          $(e).width( "550px" ).height("108px");
      }
 });

Note that e refers to the container element that encloses your message. Therefore the above code does not set the size of the popup window itself but the content of the popup window. The popup window resizes appropriately to accommodate its content.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜