Add fancy keybinds for navigating the pages click free.
This commit is contained in:
parent
b2287b8c10
commit
b0b201467f
3 changed files with 45 additions and 5 deletions
|
@ -6,6 +6,8 @@
|
|||
<link rel="stylesheet" type="text/css" media="all" href="/css/html5reset-1.6.1.css" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="/css/style.css" />
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
@ -15,16 +17,34 @@
|
|||
<header>
|
||||
<div id="title"><h1><a href="http://www.nca-guild.com">No Chicks Allowed</a></h1></div>
|
||||
<div id="links">
|
||||
<a href="/upload">Upload</a> |
|
||||
<a href="/gallery">Gallery</a> |
|
||||
<a href="/latest">Latest</a> |
|
||||
<a href="/random">Random</a>
|
||||
<a href="/upload" id="upload"><span class="underline">U</span>pload</a> |
|
||||
<a href="/gallery" id="gallery"><span class="underline">G</span>allery</a> |
|
||||
<a href="/latest" id="latest"><span class="underline">L</span>atest</a> |
|
||||
<a href="/random" id="random"><span class="underline">R</span>andom</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php echo $contents; ?>
|
||||
<script type="text/javascript">
|
||||
$(document).keydown(function(e) {
|
||||
var key = e.keyCode || e.which;
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
switch(key) {
|
||||
case 82:
|
||||
document.location.href = $('#random').attr('href');
|
||||
break;
|
||||
case 71:
|
||||
document.location.href = $('#gallery').attr('href');
|
||||
break;
|
||||
case 76:
|
||||
document.location.href = $('#latest').attr('href');
|
||||
break;
|
||||
case 85:
|
||||
document.location.href = $('#upload').attr('href');
|
||||
break;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="js/jquery.filedrop.js"></script>
|
||||
<script src="js/upload.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
<?php if($prev != 0) { ?>
|
||||
<script type="text/javascript">
|
||||
$(document).keydown(function(e) {
|
||||
var key = e.keyCode || e.which;
|
||||
if(key == 37) {
|
||||
document.location.href = $('#left>a').attr('href');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div id="left">
|
||||
<a href="<?php echo base_url($prev); ?>" class="navigation"></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if($next != 0) { ?>
|
||||
<script type="text/javascript">
|
||||
$(document).keydown(function(e) {
|
||||
var key = e.keyCode || e.which;
|
||||
if(key == 39) {
|
||||
document.location.href = $('#right>a').attr('href');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div id="right">
|
||||
<a href="<?php echo base_url($next); ?>" class="navigation"></a>
|
||||
</div>
|
||||
|
|
|
@ -352,4 +352,8 @@ h1{
|
|||
|
||||
#links a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration: underline;
|
||||
}
|
Loading…
Reference in a new issue