toastr

Adding toastr javascript asp.net webform

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to display a toastr message (info,error etc) after submitting a form using a button and update a gridview control (which is in a update panel" in asp.net webform. Thanks 回答1: You can do it using Page.ClientScript.RegisterStartupScript method. Example: Page.ClientScript.RegisterStartupScript(this.GetType(), "toastr_message", "toastr.error('There was an error', 'Error')", true); But I would probably create a method or extension method to handle that for me: public static void ShowToastr(this Page page, string message, string title,

Toastr JS Setting fadeAway value

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a cool alert js library Project: https://github.com/CodeSeven/toastr I wanted to fadeOut the following alter after a period of time. Looking at the toastr.js file, I do see the options are there. I just dont know how to access the property 'fadeAway' toastr.info('Processing...'); I tried toastr.info('Processing...', fadeAway:1000); How do I use the fadeAway by passing in a parameter ? 回答1: Before you call toastr.info, set the option you choose. For example: toastr.options.fadeOut = 2500; You can see many of the options in the demo

How to reference the bundled js files (asp.net mvc4) in Require.js?

不羁的心 提交于 2019-12-03 00:45:54
I have been studying John Papa's pluralsight course on SPA. In his main.js , he gave a name to each js library which is included in the bundle. (function () { var root = this; define3rdPartyModules(); function define3rdPartyModules() { // These are already loaded via bundles. // We define them and put them in the root object. define('jquery', [], function () { return root.jQuery; }); define('ko', [], function () { return root.ko; }); define('amplify', [], function () { return root.amplify; }); define('infuser', [], function () { return root.infuser; }); define('moment', [], function () {

Setting toastr opacity?

故事扮演 提交于 2019-12-02 20:08:53
Is there any way to change it? I tried defining the toastClass as a class with opacity set to 1, but saw no changes: .toast-style{ opacity: 1; } toastr.options.toastClass = 'toast-style'; John Papa No JavaScript required for this. You should be able to change this in CSS using either #toast-container > div { opacity:1; } or .toast { opacity: 1 !important; } #toast-container > div { opacity: 1; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); filter: alpha(opacity=100); } Test Working Example; I needed to do this for a single toastr so went this route: toastr.options = { ... };

Put a line break (newline) into a toastr message in AngularJS?

无人久伴 提交于 2019-11-30 17:28:38
I'm using this code to display toasts on an AngularJS site. I need to know how to put a line break ( <br/> ) into the body. When I use the options shown in this question , toastr renders the tag on screen, rather than interpreting it as HTML. How can I get a line break into a toast? jaycer There are two ways to allow some HTML tags, including line breaks, in a toast. Include 'body-output-type': 'trustedHtml' in toaster-options : <toaster-container toaster-options="{ 'closeButton': false, 'debug': false, 'position-class': 'toast-bottom-right', 'onclick': null, 'showDuration': '200',

Make toastr alerts look like bootstrap alerts

 ̄綄美尐妖づ 提交于 2019-11-30 13:11:51
问题 I'd like to make toastr's popup look the same as, or very close to, Bootstrap alerts. How can I do this? 回答1: Include the CSS for the Bootstrap alerts, then in your toastr options, change the values of toastClass and iconClasses: toastr.options = { toastClass: 'alert', iconClasses: { error: 'alert-error', info: 'alert-info', success: 'alert-success', warning: 'alert-warning' } }, Then in toastr's CSS, remove the dropshadow from #toast-container > div so that it ends up looking like: #toast

Make toastr alerts look like bootstrap alerts

情到浓时终转凉″ 提交于 2019-11-30 06:38:25
I'd like to make toastr's popup look the same as, or very close to, Bootstrap alerts. How can I do this? frostyterrier Include the CSS for the Bootstrap alerts, then in your toastr options, change the values of toastClass and iconClasses: toastr.options = { toastClass: 'alert', iconClasses: { error: 'alert-error', info: 'alert-info', success: 'alert-success', warning: 'alert-warning' } }, Then in toastr's CSS, remove the dropshadow from #toast-container > div so that it ends up looking like: #toast-container > div { width: 300px; } You could leave the padding if you wanted, or add that to your

Put a line break (newline) into a toastr message in AngularJS?

允我心安 提交于 2019-11-30 01:02:22
问题 I'm using this code to display toasts on an AngularJS site. I need to know how to put a line break ( <br/> ) into the body. When I use the options shown in this question, toastr renders the tag on screen, rather than interpreting it as HTML. How can I get a line break into a toast? 回答1: There are two ways to allow some HTML tags, including line breaks, in a toast. Include 'body-output-type': 'trustedHtml' in toaster-options : <toaster-container toaster-options="{ 'closeButton': false, 'debug'

Toastr JS Setting fadeAway value

心已入冬 提交于 2019-11-29 05:31:44
I am using a cool alert js library Project: https://github.com/CodeSeven/toastr I wanted to fadeOut the following alter after a period of time. Looking at the toastr.js file, I do see the options are there. I just dont know how to access the property 'fadeAway' toastr.info('Processing...'); I tried toastr.info('Processing...', fadeAway:1000); How do I use the fadeAway by passing in a parameter ? John Papa Before you call toastr.info, set the option you choose. For example: toastr.options.fadeOut = 2500; You can see many of the options in the demo here: toastr demo These are the defaults. You

Jquery消息提示插件toastr使用详解

僤鯓⒐⒋嵵緔 提交于 2019-11-27 05:58:57
引入: <script src="https://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css"> 参数配置: toastr.success( 'Hello world!' , 'Toastr fun!' ); /success 、 error、info、warning 第二个参数为标题可以省略 关闭警告框 toastr.clear([toast]); 获取当前警告框 toastr.active(); 刷新警告框 第二个参数为超时时间 toastr.refreshTimer(toast, 5000); 配置参数: toastr.options = { closeButton: false, debug: false, progressBar: true, positionClass: "toast-top-center", onclick: null, showDuration: "300", hideDuration: "1000", timeOut: "2000", extendedTimeOut