-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (32 loc) · 1.08 KB
/
Copy pathindex.html
File metadata and controls
41 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Dead Simple Dynamic Image Gallery</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
// Array that will hold the images
var images = new Array( );
// Url where to the folder where the images are located
// E.g.: http://example.de/images
var imgFolder = 'http://jerik.de/sandbox/images/';
$.get( imgFolder, function( my_var ) {
var parsed = $( '<div/>' ).append( my_var );
var as = parsed.find( 'a' );
// collect the images, currently only png's
as.each( function( index, value ) {
if ( $( this ).text( ).match( /png/ ) ) {
images.push( $( this ).text( ) );
}
} );
// Add the images to the div
$.each( images, function( index, value ) {
var img = $( '<img />' ).attr( { 'src' : imgFolder + value } ).appendTo( $( '#calvin') );
} );
});
</script>
</head>
<body>
<h2>Dead Simple Dynamic Image Gallery</h2>
<div id="calvin"></div>
</body>
</html>