最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Bootstrap: How to show modal without animation just for first time? - Stack Overflow

programmeradmin0浏览0评论

In my current project i have a link that opens modal with login form inside. When user enters wrong credentials then I reload page and show again login modal with errors. Currently I am using following code to show modal on page load:

$(function() {
    $('#login-modal').modal('show')
});

Everything is OK, but I want disable modal animation just for first time. How can I do this?

There is nothing in documentation about disabling animation just for first time

In my current project i have a link that opens modal with login form inside. When user enters wrong credentials then I reload page and show again login modal with errors. Currently I am using following code to show modal on page load:

$(function() {
    $('#login-modal').modal('show')
});

Everything is OK, but I want disable modal animation just for first time. How can I do this?

There is nothing in documentation about disabling animation just for first time

Share Improve this question edited May 23, 2016 at 5:51 raver asked May 22, 2016 at 22:16 raverraver 2836 silver badges15 bronze badges 4
  • Please read docs before asking questions – charlietfl Commented May 22, 2016 at 22:20
  • There is nothing in documentation about disabling animation just for first time – raver Commented May 22, 2016 at 22:33
  • Nothing in question about only disabling only first time either – charlietfl Commented May 22, 2016 at 22:35
  • So toggle the fade class as needed – charlietfl Commented May 23, 2016 at 12:48
Add a ment  | 

2 Answers 2

Reset to default 8

From the docs:

For modals that simply appear rather than fade in to view, remove the .fade class from your modal markup.

you should hard code the milliseconds inside modal function for quick response.

发布评论

评论列表(0)

  1. 暂无评论