Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Commit 3e23d74

Browse files
authored
Merge pull request #107 from humaan/develop
Enhancements (#62) and bug fixes for Instagram (#106 and #95)
2 parents 2d4caaa + dbd15c0 commit 3e23d74

14 files changed

Lines changed: 5269 additions & 100 deletions

File tree

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
***
44

5-
- Version 0.4.0
5+
- Version 0.4.1
66
- Requires jQuery 1.11.2 or higher (v2 not tested, v3 works but not extensively stress tested).
77
- Built by [Humaan](http://www.humaan.com)
88

@@ -50,7 +50,7 @@ Modaal is now setup and ready to be used with CDN [JSDelivr](http://www.jsdelivr
5050

5151
#### 1.4. The Basics
5252

53-
Out of the box Modaal is setup to work using inline content using as little customisation as possible. The first thing you'll require is a link to trigger the modal window. It's recommended that your `href` attribute targets a unique ID for a hidden element on the page containing your modal content. Like so..
53+
Out of the box Modaal is setup to work using inline content using as little customisation as possible. The first thing you'll require is a link to trigger the modal window. It's recommended that your `href` attribute targets a unique ID for a hidden element on the page containing your modal content. Like so:
5454

5555
```html
5656
<a href="#inline" class="inline">Show</a>
@@ -62,6 +62,20 @@ Out of the box Modaal is setup to work using inline content using as little cust
6262
$('.inline').modaal();
6363
```
6464

65+
If you would prefer your trigger element is _not_ an `<a href="#">`, you can define a `content_source` value like so:
66+
67+
```html
68+
<button class="inline">Show</button>
69+
<div id="inline" style="display:none;">
70+
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
71+
</div>
72+
```
73+
```js
74+
$('.inline').modaal({
75+
content_source: '#inline'
76+
});
77+
```
78+
6579

6680
## 2. Configuration
6781

@@ -77,6 +91,7 @@ $('.my-link').modaal({
7791
key | type | default | values | notes
7892
----|------|---------|--------|-------
7993
type|`string`|`inline`|`ajax`<br /> `inline`<br /> `image`<br /> `iframe`<br /> `confirm`<br /> `video`<br /> `instagram`|
94+
content_source|`string`|null||Accepts a string value for your target element, such as '#my-content'. This allows for when trigger element is an `<a href="#">` link. Not to be confused with the already existing `source` event.
8095
animation|`string`|`fade`|`fade`, `none`|
8196
animation_speed|`integer`|`300`||Animation speed is the duration it takes to reveal the Modaal window once triggered. It's important to note, that if you change this, you must also change the `after_callback_delay` below so that callback events sync up. This will be overwritten and set to `0` if `type` is `none`.
8297
after_callback_delay|`integer`|`350`||Specify a delay value for the after open callbacks. This is necessary because with the bundled animations have a set duration in the bundled CSS. Specify a delay of the same amount as the animation duration in so more accurately fire the after open/close callbacks. Defaults 350, does not apply if animation is 'none', after open callbacks are dispatched immediately
@@ -115,6 +130,12 @@ To enable this, the Modaal trigger link must have a class of `modaal`, then you
115130
<a href="#inline" data-modaal-type="inline" data-modaal-animation="fade" class="modaal">Show</a>
116131
```
117132

133+
Or for non `<a href="#">` elements:
134+
135+
```html
136+
<button data-modaal-content-source="#inline" data-modaal-type="inline" data-modaal-animation="fade" class="modaal">Show</button>
137+
```
138+
118139
It's important to note, that configuration options that contain an underscore (`_`) in them need to be replaced with a hyphen (`-`) in it's respective html attribute. For example, `overlay_opacity` configuration would read `data-overlay-opacity="0.8"`.
119140

120141

demo/css/demo.css

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ hr {
157157
.btn.btn-download span strong {
158158
position: relative;
159159
z-index: 1; }
160+
.btn + .btn {
161+
margin-left: 20px; }
160162

161163
.share {
162164
margin: 60px 0 0; }
@@ -176,9 +178,8 @@ hr {
176178
width: 50px;
177179
height: 50px;
178180
border: 2px solid #eee;
179-
-webkit-transform: translate(-50%, -50%);
180-
-ms-transform: translate(-50%, -50%);
181-
transform: translate(-50%, -50%);
181+
-ms-transform: translate(-50%, -50%);
182+
transform: translate(-50%, -50%);
182183
position: absolute;
183184
top: 50%;
184185
left: 50%;
@@ -249,15 +250,12 @@ hr {
249250
width: 30px;
250251
height: 60px;
251252
margin: 0 0 0 -15px;
252-
transition: -webkit-transform 0.3s;
253253
transition: transform 0.3s;
254-
-webkit-transform: translateY(0);
255-
-ms-transform: translateY(0);
256-
transform: translateY(0); }
254+
-ms-transform: translateY(0);
255+
transform: translateY(0); }
257256
.scroll-trigger:focus, .scroll-trigger:hover {
258-
-webkit-transform: translateY(15px);
259-
-ms-transform: translateY(15px);
260-
transform: translateY(15px); }
257+
-ms-transform: translateY(15px);
258+
transform: translateY(15px); }
261259
.scroll-trigger:focus .scroll-arrow, .scroll-trigger:hover .scroll-arrow {
262260
background: #6d4d9a; }
263261
.scroll-trigger:focus .scroll-arrow:before, .scroll-trigger:focus .scroll-arrow:after, .scroll-trigger:hover .scroll-arrow:before, .scroll-trigger:hover .scroll-arrow:after {
@@ -283,14 +281,12 @@ hr {
283281
bottom: 3px;
284282
transition: background-color 0.3s; }
285283
.scroll-arrow:before {
286-
-webkit-transform: rotate(45deg);
287-
-ms-transform: rotate(45deg);
288-
transform: rotate(45deg);
284+
-ms-transform: rotate(45deg);
285+
transform: rotate(45deg);
289286
margin: 0 0 0 -14px; }
290287
.scroll-arrow:after {
291-
-webkit-transform: rotate(-45deg);
292-
-ms-transform: rotate(-45deg);
293-
transform: rotate(-45deg);
288+
-ms-transform: rotate(-45deg);
289+
transform: rotate(-45deg);
294290
margin: 0 0 0 -1px; }
295291

296292
.modaal-fixed-header {
@@ -299,17 +295,15 @@ hr {
299295
left: 0;
300296
width: 100%;
301297
height: 70px;
302-
box-shadow: 0 0 5px transparent;
298+
box-shadow: 0 0 5px rgba(0, 0, 0, 0);
303299
background: #6d4d9a;
304-
-webkit-transform: translateY(0);
305-
-ms-transform: translateY(0);
306-
transform: translateY(0);
300+
-ms-transform: translateY(0);
301+
transform: translateY(0);
307302
transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); }
308303
.modaal-fixed-header.reveal {
309304
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
310-
-webkit-transform: translateY(70px);
311-
-ms-transform: translateY(70px);
312-
transform: translateY(70px); }
305+
-ms-transform: translateY(70px);
306+
transform: translateY(70px); }
313307
.modaal-fixed-header .modaal-logo {
314308
display: block;
315309
float: left;

demo/css/demo.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ hr {
168168
}
169169
}
170170
}
171+
+ .btn {
172+
margin-left: 20px;
173+
}
171174
}
172175

173176
.share {

dist/css/modaal.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
Modaal - accessible modals - v0.4.0
2+
Modaal - accessible modals - v0.4.1
33
by Humaan, for all humans.
44
http://humaan.com
55
*/

dist/css/modaal.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/modaal.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
Modaal - accessible modals - v0.4.0
2+
Modaal - accessible modals - v0.4.1
33
by Humaan, for all humans.
44
http://humaan.com
55
*/

0 commit comments

Comments
 (0)