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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
   | <!doctype HTML>
<html>
<head>
<title>Creation d'un scrollbar comme facebook</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="jquery.mousewheel.js"></script>
<script src="jquery.jscrollpane.min.js"></script>
<linl rel="stylesheet" type="text/css" href="jquery.jscrollpane.css">
<script>
$(function() {
    $('.content-area').jScrollPane();
});
 
$('.content-area').jScrollPane({
    horizontalGutter:5,
    verticalGutter:5,
    'showArrows': false
});
 
$('.jspDrag').hide();
$('.jspScrollable').mouseenter(function(){
    $(this).find('.jspDrag').stop(true, true).fadeIn('slow');
});
$('.jspScrollable').mouseleave(function(){
    $(this).find('.jspDrag').stop(true, true).fadeOut('slow');
});
</script>
<style type="text/css">
#contenue
{
 background-color:green;
 width:150px;
 height:150px;
}
 
.jspVerticalBar {
    width: 8px;
    background: transparent;
    right:10px;
}
 
.jspHorizontalBar {
    bottom: 5px;
    width: 100%;
    height: 8px;
    background: transparent;
}
.jspTrack {
    background: transparent;
}
 
.jspDrag {
    background: url(transparent-black.png) repeat;
    -webkit-border-radius:4px;
    -moz-border-radius:4px;
    border-radius:4px;
}
 
.jspHorizontalBar .jspTrack,
.jspHorizontalBar .jspDrag {
    float: left;
    height: 100%;
}
 
.jspCorner {
    display:none
}
</style>
</head>
<body>
<div id="contenue" class="content-area">
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
a<br>
</div>
</body>
</html> | 
Partager