Last change
on this file since 200 was
200,
checked in by vmipsl, 13 years ago
|
Livraison _ confs + extrations path /resources + visualisation images/bouton
|
File size:
1.0 KB
|
Line | |
---|
1 | /* |
---|
2 | With the following code, Slimbox will activate itself automatically on all links pointing to images, |
---|
3 | or more specifically all links having URLs ending with: ".jpg" or ".png" or ".gif". |
---|
4 | As a result, you will not need to set the rel="lightbox" attribute on any link to activate Slimbox. |
---|
5 | Furthermore, all image links contained in the same block or paragraph (having the same parent element) |
---|
6 | will automatically be grouped together in a gallery, so you will not need to specify groups either. |
---|
7 | Images that are alone in their block or paragraph will be displayed individually. |
---|
8 | |
---|
9 | Replace the default autoload code block with this one. |
---|
10 | */ |
---|
11 | |
---|
12 | Slimbox.scanPage = function() { |
---|
13 | $$("a[href]").filter(function(el) { |
---|
14 | return el.href.test(/\.(jpg|png|gif)$/i); |
---|
15 | }).slimbox({}, null, function(el) { |
---|
16 | return (this == el) || (this.parentNode && (this.parentNode == el.parentNode)); |
---|
17 | }); |
---|
18 | }; |
---|
19 | if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) { |
---|
20 | window.addEvent("domready", Slimbox.scanPage); |
---|
21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.