Frage

Wer kein Glück hat immer JScrollPane mit JQuery zu arbeiten?

Ich folge den Anweisungen auf das Schreiben und alles, was passiert ist, dass, wenn die Seite geladen wird, verbirgt sich der Anruf nur auf die Bildlaufleiste des Browsers aber machen nicht die benutzerdefinierte Bildlaufleiste.

Dateien in Test HTML-Seite enthalten:

http://70.85.188.226/_assets/css/jscrollpane.css

http://70.85.188.226/_assets/js/jquery-1.2.3.min.js

http://70.85.188.226/_assets/js/jscrollpane.js

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="/_assets/css/jscrollpane.css" media="screen,projection,print" />  
<script type="text/javascript" src="/_assets/js/jquery-1.2.3.min.js"></script>
<script type="text/javascript" src="/_assets/js/jscrollpane.js"></script> 
<style type="text/css">
#test
{
    width:400px;
    height:300px;
    overflow:auto;
    background-color:#2b2b2b;
    color:#ffffff;
}
</style>
<script type="text/javascript">
    $(function()
    {
        $('#test').jScrollPane();
    });
</script>
</head>
<body>
<div id="test">
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST</div>
    <div style="clear:both;"></div>
    <div style="height:36px;">TEST12</div>
    <div style="clear:both;"></div>
</div>
</body>
</html>
War es hilfreich?

Lösung

Es könnte sein, dass Sie die erforderliche Klassendeklaration für Ihren Test div fehlt sind.

JScrollPane anwenden zu können müssen Sie die Klasse für den Test div auf "Scroll-pane".

Andere Tipps

Überprüfen Sie Zeile 50 der JScrollPane JavaScript-Datei.

if (percentInView < .99) {

Dies verursacht wurde mir ein Problem,

I console.log()'d es Wert ist, und es wurde die Rückkehr immer über .99, so war es nie die Scroll-Elemente hinzufügen. Ich sage voraus, das etwas haben könnte damit zu tun, wie mein CSS eingerichtet ist. Ich würde empfehlen, bei der CSS suchen.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top