TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Sweet Alert for Bootstrap – Blends nicely with any Bootstrap based project

95 点作者 lipis超过 10 年前

19 条评论

akvlad超过 10 年前
I agree this does look sweet, however this is not a replacement for alert. window.alert() is a blocking function, it prevents further code to be interpreted while the alert or prompt is open.
评论 #8488058 未加载
评论 #8488054 未加载
mandeepj超过 10 年前
Please have "Esc" key cancel\close the dialog box. It is the inherent behavior please do not break it.
评论 #8488031 未加载
mk4p超过 10 年前
I met the most interesting guy once. He was a professor at Columbia and a consultant for Wall Street, helping design UIs for traders.<p>He explained how we process and prioritize visual cues -- how, if an element expands equally to the left AND right of our field of vision, it gets highest priority because it resembles an object heading toward our face.<p>For that reason, he avoided this design for everything except the highest-priority events.<p>Not crapping on your library -- it looks really nice :) But in general, I think it&#x27;s worth considering if it&#x27;s necessary to demand users&#x27; attention all over the place. I think information overload isn&#x27;t solely in the content we consume but how it&#x27;s presented.
warble超过 10 年前
I&#x27;ve been seeing a few of these libs pop up on HN lately. Apparently there&#x27;s some sort of need here that people are trying to fill, it&#x27;s just not clear to me what it is.<p>There are legitamite suggestions that blocking UI paradigms are bad, but they&#x27;re very useful at times. I&#x27;m not arguing either, as I think each has their place (although I tend to avoid blocking personally if I can)<p>My real question is why now?
评论 #8488493 未加载
execat超过 10 年前
The way the alert comes in is very annoying.<p>The homepage doesn&#x27;t tell me if I can customize the animation.
aidos超过 10 年前
It would be nice if it was possible to select &#x2F; copy the message in the box. Sometimes you get a message that you want to copy &#x2F; paste to someone (email, chat, etc) and it&#x27;s annoying to have to type it out again.
JoshTriplett超过 10 年前
Nice style, and I appreciate that I can hit Esc to dismiss most of the dialogs, though unfortunately not all of them.<p>As another commenter said, I do wish that clicking outside of it had the same effect, but that may have more to do with what sites typically abuse these kinds of boxes for (&quot;Alert! Sign up to our...&quot; (no go away)).<p>One issue I noticed: there&#x27;s a race condition in the second-to-last example (&#x27;...and by passing a parameter, you can execute something else for &quot;Cancel&quot;.&#x27;), where if you hit escape quickly enough as the box gets launched, the cancellation handler does not run.
评论 #8487989 未加载
marknutter超过 10 年前
Isn&#x27;t this just a modal?
评论 #8488175 未加载
评论 #8488074 未加载
decentrality超过 10 年前
This really needs to be added to <a href="http://jsdelivr.com" rel="nofollow">http:&#x2F;&#x2F;jsdelivr.com</a> so we can package it in with existing CDN calls.<p>There seem to be very sparse examples of how to deploy the library properly, only to implement it.<p>Visually great. Cool how there&#x27;s the ability to catch responses and work in the same modal further.
评论 #8488446 未加载
yournemesis超过 10 年前
I still don&#x27;t get why javascript developers put so much effort into a library and don&#x27;t provide tests for it.
评论 #8488015 未加载
FreakyT超过 10 年前
I usually find alert libraries boring, but these are really cool -- I particularly enjoy the icon drawing animations.
jcagalawan超过 10 年前
Slight clipping issue <a href="http://imgur.com/TKAk41f" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;TKAk41f</a>
评论 #8488079 未加载
amatera超过 10 年前
swal(&quot;Here&#x27;s a message!&quot;) !== alert(&quot;Here&#x27;s a message!&quot;)<p>Am i wrong or is a replacement not something which replace the original function? (beside the blocking aspect of an alert). Looks beautiful anyway :)
j_syk超过 10 年前
Looks cool. I&#x27;d like to see [esc] to close dialog. And is it a safe default to have [enter] perform the action especially on warning and danger? (just a thought)
coreymgilmore超过 10 年前
This is an eerily similar project to something posted a few weeks ago here. Most notably, the exact same &quot;success&quot; animation.<p><a href="https://news.ycombinator.com/item?id=8420902" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8420902</a><p><a href="https://github.com/t4t5/sweetalert" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;t4t5&#x2F;sweetalert</a>
评论 #8488085 未加载
评论 #8488090 未加载
emodendroket超过 10 年前
Why would I use this instead of the built-in modals? Seems like it does the same thing.
评论 #8488188 未加载
NDizzle超过 10 年前
Just in time for Halloween! Scary, jarring alerts.
csbrooks超过 10 年前
Very slick!
iand675超过 10 年前
The icon animations are really slick!