Div Positioning + Other stuff

From: af (CAER)28 Oct 2010 09:10
To: ANT_THOMAS 5 of 8

Something Mikee uses which he loves (but I find a bit heavy for my needs):
http://layout.jquery-dev.net/

 

ALSO: slightly off-topic but have you tried using square frames for your thumbnails? As it is now, your landscape-orientated thumbs are bigger (and visually more prominent) than the portrait-oriented ones.

EDITED: 28 Oct 2010 09:23 by CAER
From: ANT_THOMAS28 Oct 2010 15:01
To: af (CAER) 6 of 8
I'd like to use square frames for portrait photos but I haven't generated the thumbs myself, they're generated by the PHP script.
From: ANT_THOMAS28 Oct 2010 15:04
To: ALL7 of 8

May as well keep it in the same thread because it's more stuff about my gallery.

 

I'm fairly happy with how it looks and works but one thing I'd love it to do it be able to go to next and previous photos like you can with Facebook and Lightbox galleries, as well as many others online, by pressing the right and left cursor keys.

 

I've been searching for hours now trying to figure it out. Looking at onkeypress, onkeyup, onkeydown but can't figure out how to get anything in a workable form.

 

The next and previous links are generated by PHP so it just needs to be able to replicate those.

From: af (CAER)28 Oct 2010 15:47
To: ANT_THOMAS 8 of 8
A quick search suggests keyboard event detection is a bitch.
However, this page offers some clues.
javascript code:
 
var keyDown = function(e) {
    var evt = e || window.event;
    switch (evt.keyCode) {
        case 37: { // left arrow key
            window.location = URL_FOR_NEXT_PAGE;
        }
        case 39: { // right arrow key
            window.location = URL_FOR_PREV_PAGE;
        }
    }
    return document.defaultAction; // might not be needed
    // (I use jQuery which makes a lot of this stuff easier)
}; // keyDown()
 
// I dunno where you'd put this bit - <body onload="..."> maybe?
document.onkeydown = keyDown;
 
EDITED: 28 Oct 2010 15:49 by CAER