mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
added basic image loader...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0fadf170b3
commit
5a4a7ceb05
@ -100,8 +100,43 @@ $(document).ready(function() {
|
||||
|
||||
// set the default position...
|
||||
$('.current-image').click()
|
||||
|
||||
// load images...
|
||||
// XXX not allowed...
|
||||
//$.getJSON('images.js', loadImages})
|
||||
// XXX STUB
|
||||
loadImages({
|
||||
images:[
|
||||
'images/350px/DSC_3501.jpg',
|
||||
'images/350px/DSC_3503.jpg',
|
||||
'images/350px/DSC_3504.jpg',
|
||||
'images/350px/DSC_3506.jpg',
|
||||
]
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
function loadImages(json){
|
||||
// XXX STUB
|
||||
var images = json.images
|
||||
var ribbon = $('.ribbon').last()
|
||||
|
||||
|
||||
$('.image').remove()
|
||||
|
||||
for(var i = 0; i < images.length; i++){
|
||||
$('<div class="image mock-image"></div>')
|
||||
.css({
|
||||
background : 'url('+images[i]+') no-repeat 50% black',
|
||||
'background-size': 'contain',
|
||||
})
|
||||
.click(handleClick)
|
||||
.appendTo(ribbon)
|
||||
}
|
||||
ribbon.children().first().click()
|
||||
|
||||
}
|
||||
|
||||
// XXX jquery.gestures handler...
|
||||
function handleGestures(e){
|
||||
switch (e){
|
||||
@ -251,15 +286,11 @@ function firstImage(){
|
||||
}
|
||||
|
||||
function prevImage(){
|
||||
$('.current-image')
|
||||
.prev('.image')
|
||||
.click()
|
||||
$('.current-image').prev('.image').click()
|
||||
}
|
||||
|
||||
function nextImage(){
|
||||
$('.current-image')
|
||||
.next('.image')
|
||||
.click()
|
||||
$('.current-image').next('.image').click()
|
||||
}
|
||||
|
||||
function lastImage(){
|
||||
|
||||
7
ui/images.json
Executable file
7
ui/images.json
Executable file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"images":[
|
||||
"image 1",
|
||||
"image 2",
|
||||
"image 3"
|
||||
]
|
||||
}
|
||||
BIN
ui/images/350px/DSC_3501.jpg
Executable file
BIN
ui/images/350px/DSC_3501.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
ui/images/350px/DSC_3503.jpg
Executable file
BIN
ui/images/350px/DSC_3503.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
ui/images/350px/DSC_3504.jpg
Executable file
BIN
ui/images/350px/DSC_3504.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
ui/images/350px/DSC_3506.jpg
Executable file
BIN
ui/images/350px/DSC_3506.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
0
ui/images/README
Normal file
0
ui/images/README
Normal file
Loading…
x
Reference in New Issue
Block a user