Skip to content

Commit f36f4d5

Browse files
committed
Updated markup
1 parent cc8f8b4 commit f36f4d5

File tree

1 file changed

+50
-47
lines changed

1 file changed

+50
-47
lines changed

README.md

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
jBox
2-
====
1+
# jBox
32

43
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
54

@@ -8,76 +7,80 @@ Demo: https://stephanwagner.me/jBox
87
Docs: https://stephanwagner.me/jBox/documentation
98

109

11-
Tooltips
12-
--------
10+
## Tooltips
1311

1412
Create a new instance of jBox Tooltip and attach it to elements:
1513

16-
new jBox('Tooltip', {
17-
attach: '.tooltip'
18-
});
14+
```javascript
15+
new jBox('Tooltip', {
16+
attach: '.tooltip'
17+
});
18+
```
1919

20-
Now elements with class="tooltip" will open tooltips:
20+
Now elements with `class="tooltip"` will open tooltips:
2121

22-
<span class="tooltip" title="My first tooltip">Hover me!</span>
23-
<span class="tooltip" title="My second tooltip">Hover me!</span>
22+
```html
23+
<span class="tooltip" title="My first tooltip">Hover me!</span>
24+
<span class="tooltip" title="My second tooltip">Hover me!</span>
25+
```
2426

25-
26-
Modal windows
27-
-------------
27+
## Modal windows
2828

2929
You can set up modal windows the same way as tooltips.
3030
But most of times you'd want more variety, like a title or HTML content:
3131

32-
new jBox('Modal', {
33-
width: 300,
34-
height: 200,
35-
attach: '#myModal',
36-
title: 'My Modal Window',
37-
content: '<i>Hello there!</i>'
38-
});
39-
40-
<div id="myModal">Click me to open a modal window!</div>
41-
32+
```javascript
33+
new jBox('Modal', {
34+
width: 300,
35+
height: 200,
36+
attach: '#myModal',
37+
title: 'My Modal Window',
38+
content: '<i>Hello there!</i>'
39+
});
40+
```
41+
```html
42+
<div id="myModal">Click me to open a modal window!</div>
43+
```
4244

4345

44-
Confirm windows
45-
---------------
46+
## Confirm windows
4647

4748
Confirm windows are modal windows which requires the user to confirm a click action on an element.
4849
Give an element the attribute data-confirm to attach it:
4950

50-
new jBox('Confirm', {
51-
confirmButton: 'Do it!',
52-
cancelButton: 'Nope'
53-
});
54-
55-
<div onclick="alert('You did it!')" data-confirm="Do you really want to do this?">Click me!</div>
56-
<a href="https://stephanwagner.me/jBox" data-confirm="Do you really want to leave this page?">Click me!</a>
57-
51+
```javascript
52+
new jBox('Confirm', {
53+
confirmButton: 'Do it!',
54+
cancelButton: 'Nope'
55+
});
56+
```
57+
```html
58+
<div onclick="alert('You did it!')" data-confirm="Do you really want to do this?">Click me!</div>
59+
<a href="https://stephanwagner.me/jBox" data-confirm="Do you really want to leave this page?">Click me!</a>
60+
```
5861

59-
Notices
60-
-------
62+
## Notices
6163

6264
A notice will open automatically and destroy itself after some time:
6365

64-
new jBox('Notice', {
65-
content: 'Hurray! A notice!'
66-
});
66+
```javascript
67+
new jBox('Notice', {
68+
content: 'Hurray! A notice!'
69+
});
70+
```
6771

68-
69-
Images
70-
------
72+
## Images
7173

7274
To create image windows you only need following few lines:
7375

74-
new jBox('Image');
75-
76-
<a href="/image-large.jpg" data-jbox-image="gallery1" title="My image"><img src="/image.jpg" alt=""></a>
77-
76+
```javascript
77+
new jBox('Image');
78+
```
79+
```html
80+
<a href="/image-large.jpg" data-jbox-image="gallery1" title="My image"><img src="/image.jpg" alt=""></a>
81+
```
7882

79-
Learn more
80-
----------
83+
## Learn more
8184

8285
These few examples are very basic.
8386
The jBox library is quite powerful and offers a vast variety of options to customize appearance and behavior.

0 commit comments

Comments
 (0)