“Galerie” is a lightweight and flexible script for presenting images. In order to get an idea how it works, see it live:
| <- | previous image |
| -> | next image |
| s | start / pause slideshow |
| + | resize image to original size |
| - | resize image to viewport |
| Enter | toggle image size |
| Esc | close image view |
“Galerie” has two dependences: whenDOMReady and addEvent. They are part of the download package and, like the main script, published under the LGPL. All the .js files have to be tied in your document:
<script type="text/javascript" src="addEvent.js"></script> <script type="text/javascript" src="Galerie.js"></script>
Furthermore you’ll need a theme. After choosing one, add its Galerie.css to your page.
If you want to keep it really simple, just put the theme with all its files into the document’s directory. Otherwise, make sure that all paths in your Galerie.css are correct. Most important, cursor:url(...) and filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='... have to be relatively to the document’s location.
Now the script is actually ready. If there’s an element with id="Galerie", all contained links to images will be grabbed. Define the title attribute in order to display an image title in the gallery view:
<p id="Galerie"> <a href="1.png">1</a>, <a href="2.jpg">2</a>, <a href="3.gif" title="great!">3</a>, ... </p>
To add all linked pictures to a gallery, you may assign the mentioned id attribute to <body>. Alternatively, you can instantiate Galerie manually; either for the entire document:
<script type="text/javascript">
whenDOMReady (function() {
new Galerie (document)
})
</script>
… or for selected elements:
<script type="text/javascript">
whenDOMReady (function() {
new Galerie (document.getElementById('holidays'));
new Galerie (document.getElementById('cebit07'));
})
</script>
Each instance represents an independent gallery. E.g., in order to create a gallery for each of your WordPress blog posts, you can use getElementsByClassName:
<script type="text/javascript" src="getElementsByClassName.js"></script>
<script type="text/javascript">
whenDOMReady (function() {
var posts = getElementsByClassName(document, 'div', 'post');
for (var post, i = 0; post = posts[i]; i++)
new Galerie (post);
})
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Galerie</title>
<script type="text/javascript" src="addEvent.js"></script>
<script type="text/javascript" src="Galerie.js"></script>
<link rel="stylesheet" media="screen,projection" type="text/css" href="Galerie.css"/>
<style type="text/css"> body { background: blue } a { color: white } </style>
</head>
<body id="Galerie">
<a href="http://www.spiegel.de/static/sys/logo_120x61.gif">1</a>
<a href="http://www.google.com/images/logo_sm.gif">2</a>
<a href="http://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png">3</a>
</body>
</html>
Themes are an integral part of “Galerie”. All the visuals are left to a CSS file, thus the appearance is customizable without touching the actual script. In case you’ve created a new theme, feel free to contact me (dao at design-noir.de). I’ll add it to the list.
| Package | Size | Preview | Author |
|---|---|---|---|
| black-bars_1.8.14.tar.gz | 2.78 KB | Dao G. | |
| ie7_1.8.14.tar.gz | 10.76 KB | Dao G. | |
| lighter_1.8.14.tar.gz | 954 Bytes | Dao G. | |
| medieval_1.8.14.tar.gz | 4.75 KB | Erik-B. Ernst, C. M. Werner |
|
| nuvola_1.8.14.tar.gz | 9.44 KB | Dao G. | |
| plastique_1.8.14.tar.gz | 7.03 KB | Dao G. | |
| plastique-ontop_1.8.14.tar.gz | 6.97 KB | Dao G. | |
| tango-ontop_1.8.14.tar.gz | 6.78 KB | Dao G. | |
| textual-bars_1.8.14.tar.gz | 2.08 KB | Dao G. |
body { position: absolute } (Galerie will set position to static and revert this when closed.)
Report an issue (dao at design-noir.de).
DOMContentLoaded event emulated for IE
appendChild(document.createTextNode()) and firstChild.nodeValue instead of innerHTML
Function.prototype.bind
$A to Array.from
-ms-interpolation-mode: bicubic;
title attribute for navigation buttons
DOMContentLoaded event for faster initialization in Gecko-based browsers and Opera 9
Galerie instances (cache object has to be initialized inside of constructor instead of the prototype object)
defaultImgWidth and defaultImgHeight
Hi habe da ein Problem mit meinem Frameset.Wenn das Skript auf der Galerie-Seite in Main eingebunden ist, sollten es keine Probleme geben.
Habe 3 Frames
Head
Navi
Main
im Main ist die Seite Galerie eingebunden auf der ich die Bilder verlinken wollte.
hab alles so gemacht wie beschreiben aber ich bekomms´einfach nicht hin.
kann das am frameset liegen??
Comments are closed.