2.0.1 • Published 3 years ago

bootstrap-modal-js v2.0.1

Weekly downloads
70
License
MIT
Repository
github
Last release
3 years ago

bootstrap-modal-js

Currently supports bootstrap v5.1.2

Bootstrap 5 components "Modal"

Currently relying on Bootstrap v5, because it is a function package of Bootstrap modal.

Supports arbitrary calls of 9 parameters, supports callback functions based on modal events.


If it helps you, please star this repository


Demo

https://ZhangChengLin.github.io/bootstrap-modal-js/demo.html



Table of Contents

How to use it
How to install
CDN
Parameter Description
Donate
License

How to use it

<script src="https://cdn.jsdelivr.net/npm/bootstrap-modal-js/dist/bootstrap-modal-js.min.js"></script>
<script src="./dist/bootstrap-modal-js.js"></script>

<a href="javascript:;" onclick="bootstrapModalJs(parameter)">text</a>

OR

<a href="javascript:;" id="xx">text</a>

<script src="https://cdn.jsdelivr.net/npm/bootstrap-modal-js/dist/bootstrap-modal-js.min.js"></script>
<script src="./dist/bootstrap-modal-js.js"></script>
<script>
    const xx = document.querySelector("#xx");
    xx.addEventListener("click", function () {
        bootstrapModalJs(parameter);
    }
</script>

OR MORE

How to install

npm i bootstrap-modal-js --save

OR

cnpm i bootstrap-modal-js --save

CDN

  • jsDelivr
<script src="https://cdn.jsdelivr.net/npm/bootstrap-modal-js/dist/bootstrap-modal-js.min.js"></script>

OR

<script src="https://cdn.jsdelivr.net/npm/bootstrap-modal-js/dist/bootstrap-modal-js.js"></script>
  • UNPKG

View all versions

https://unpkg.com/bootstrap-modal-js/

After the browser parses, get the latest version address

https://unpkg.com/bootstrap-modal-js

Parameter Description

bootstrapModalJs(title, body, footer, ModalSizes, VerticallyCentered, LongContentType, EventType, CallbackFunction, Options)

Return Values

typesuch asDescription
String1552756356601modal element number

  • title

Type: String | Function | Function HTMLElement

Default value: undefined

Description: If you want to add a child element to the '.modal-header' element, use the Function HTMLElement.

说明: 如果要向 ".modal-header" 元素添加子元素,请使用 Function HTMLElement。


  • body

Type: String | Function | Function HTMLElement

Default value: undefined

Description:


  • footer

Type: String | Function | Function HTMLElement

Default value: undefined

Description:


  • ModalSizes

Type: String

Default value: undefined

Description:

parameter
sm
lg
xl
full
full-sm
full-md
full-lg
full-xl
full-xxl

  • VerticallyCentered

Type: Boolean

Default value: false

Description:

parameter
true
false

  • LongContentType

Type: Boolean

Default value: false

Description:

parameter
true
false

  • EventType

Type: String

Default value: undefined

Description:

parameter
show
shown
hide
hidden

  • CallbackFunction

Type: Function

Default value: undefined

Description:


  • Options

Type: Object

Default value:

Description: Bootstrap Modal options

parameterdefault value (boolean)other
backdroptruefalse | "static"
keyboardtruefalse
focustruefalse
showtruefalse

Donate

Method (priority)type
alipay (支付宝)QR code
QQQR code
WeChat (微信)
PayPal (贝宝)PayPal.Me

License

MIT

under the MIT License (license terms are at https://opensource.org/licenses/MIT).

2.0.1

3 years ago

2.0.0-beta3

3 years ago

2.0.0-beta2

3 years ago

2.0.0-beta1

3 years ago

2.0.0-alpha2

4 years ago

2.0.0-alpha1

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.1

5 years ago

1.0.0-beta

5 years ago

0.0.1-beta.2

5 years ago

0.0.1-beta.1

5 years ago

0.0.1-beta

5 years ago

0.0.1-alpha.beta

5 years ago

0.0.1-alpha.3

5 years ago

0.0.1-alpha.2

5 years ago

0.0.1-alpha.1

5 years ago

0.0.1-alpha

5 years ago