
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
None | size: 2.57 KB | hits: 16 | expires: Never
<?php
$src = "";
class functions{
function lister($dir){
return scandir($dir);
}
function display(){
$files = $this->lister("c:/xampp/htdocs");
unset($files[0]);
unset($files[1]);
foreach($files as $file){
if($file){
echo "<div id='item'><a href='{$file}'>{$file}</a></div>";
}
}
}
}
$func = new functions;
?>
<!DOCTYPE html>
<html>
<head>
<title>List it</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://www.class.pm/files/jquery/uscrollbar/demo/js/jquery.uscrollbar.js"></script>
<script>
$(function(){
$("#full a").click(function(){
$('iframe#load').attr('src', this);
return false;
});
$("#full").uscrollbar();
});
</script>
<style>
.scrollbar-path-vertical {
position: absolute;
background-color: #eee;
background-color: rgba(220,220,220,0.5);
z-index: 100;
}
.scrollbar-path-vertical {
right: 5px;
top: 0;
height: 100%;
width: 10px;
}
.scrollbar-path-vertical {
box-shadow: inset 1px 0px 1 rgba(0,0,0,0.1);
-moz-box-shadow: inset 1px 0px 1 rgba(0,0,0,0.1);
-webkit-box-shadow: inset 1px 0px 0 rgba(0,0,0,0.1);
}
.scrollbar-handle{
position: relative;
top: 0;
left: 0;
background-color: #000000;
}
.scrollbar-path-vertical .scrollbar-handle {
height: 20%;
width: 100%;
}
.scrollbar-path-vertical, .scrollbar-handle {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
</style>
<style>
html, body{
font-family: Helvetica;
margin:0;
padding:0;
background-image: url("http://phpacademy.org/images/background.png");
}
#full{
position:absolute;
height:700px;
width:300px;
left:0;
overflow-y: scroll;
top:25px;
}
#preview{
position:absolute;
height:700px;
left:300px;
top:25px;
right:0;
border:1px solid black;
}
#item{
background-color:#ccc;
width:275px;
padding:3px;
margin:5px 5px 0px 0px;
}
#item:hover{
padding-left:15px;
}
#item a{
text-decoration: none;
color: rgba(0,0,0,.6);
font-weight: bold;
}
#item a:hover{
color: rgba(0,0,0,1);
}
</style>
</head>
<body>
<div id="wrapper">
<div id="full">
<?php
$func->display();
?>
</div>
<div id="preview">
<iframe id="load" style="width:100%; height:100%;border:none;"border="0"></iframe>
</div>
</div>
</body>
</html>