javascript - JS 滚动条不起作用

标签 javascript jquery html

我有这个脚本,可以拖动一系列 <li>是按时间轴上的年份组织的。但是,我无法在页面中水平拖动。有更好的干草吗?可能出了什么问题?

    $(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */

$(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */

    /* The number of event sections / years with events */
    var tot=$('.event').length;

    $('.eventList li').click(function(e){
            showWindow('<div>'+$(this).find('div.content').html()+'</div>');
    });

    /* Each event section is 320 px wide */
    var timelineWidth = 320*tot;
    var screenWidth = $(document).width();

    $('#timelineScroll').width(timelineWidth);

    /* If the timeline is wider than the screen show the slider: */
    if(timelineWidth > screenWidth)
    {
        $('#scroll,#slider').show();
        $('#centered,#slider').width(120*tot);

        /* Making the scrollbar draggable: */
        $('#bar').width((120/320)*screenWidth).draggable({

            containment: 'parent',
            drag: function(e, ui) {

                if(!this.elem)
                {
                    /* This section is executed only the first time the function is run for performance */

                    this.elem = $('#timelineScroll');

                    /* The difference between the slider's width and its container: */
                    this.maxSlide = ui.helper.parent().width()-ui.helper.width();

                    /* The difference between the timeline's width and its container */
                    this.cWidth = this.elem.width()-this.elem.parent().width();
                    this.highlight = $('#highlight');
                }

                /* Translating each movement of the slider to the timeline: */
                this.elem.css({marginLeft:'-'+((ui.position.left/this.maxSlide)*this.cWidth)+'px'});

                /* Moving the highlight: */
                this.highlight.css('left',ui.position.left)
            }
        });

        $('#highlight').width((120/320)*screenWidth-3);
    }

});
body,h1,h2,h3,p,quote,small,form,input,ul,li,ol,label{
	/* Simple page reset */
	margin:0;
	padding:0;
}

body{
	/* Setting default text color, background and a font stack */
	color:#555555;
	font-size:0.825em;
	background: #fcfcfc;
	font-family:Arial, Helvetica, sans-serif;
}

.event{
	/* Contains the event header and body list */
	float:left;
	padding:4px;
	text-align:left;
	width:300px;
	margin:0 5px 50px;
}

.eventList li{
	/* The individual events */
	background:#F4F4F4;
	border:1px solid #EEEEEE;
	list-style:none;
	margin:5px;
	padding:4px 7px;
	
	/* CSS3 rounded corners */
	-moz-border-radius:4px;
	-webkit-border-radius:4px;
	border-radius:4px;
}

.eventList li:hover{
	/* The hover state: */
	cursor:pointer;
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	color:#548DA5;
}

li span{
	/* The event icon */
	display:block;
	float:left;
	height:16px;
	margin-right:5px;
	width:16px;
}

/* Individual background images for each type of event: */

li.news span.icon { 	background:url(img/icons/newspaper.png) no-repeat; }
li.image span.icon { 	background:url(img/icons/camera.png) no-repeat; }
li.milestone span.icon { 	background:url(img/icons/chart.png) no-repeat; }

div.content{
	/* This div contains additional data for the content */
	display:none;
}

.eventHeading{
	/* The colorful year headings at the top */
	font-size:2em;
	margin:-5px -5px 10px;
	padding:2px 5px;
	text-align:center;
}

/* Three color styles for the headings: */

.eventHeading.chreme{
	background:#FBF7F0;
	border:1px solid #EEE4D4;
	color:#A78B5F;
}

.eventHeading.blue{
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	color:#548DA5;
}

.eventHeading.green{
	background:#E6FFDF none repeat scroll 0 0;
	border:1px solid #C9E6C1;
	color:#6EA85F;
}

#timelineLimiter{
	/* Hides the overflowing timeline */
	width:100%;
	overflow:hidden;
	padding-top:10px;
	margin:40px 0;
}

#scroll{
	/* The small timeline below the main one. Hidden here and shown by jQuery if JS is enabled: */
	display:none;
	height:30px;

	background:#F5F5F5;
	border:1px solid #EEEEEE;
	color:#999999;
}

.scrollPoints{
	/* The individual years */
	float:left;
	font-size:1.4em;
	padding:4px 10px;
	text-align:center;
	width:100px;
	
	position:relative;
	z-index:10;
}

#centered{
	/* Centers the years, width is assigned by jQuery */
	margin:0 auto;
	position:relative;
}

#slider{
	/* Holds the scroll bar */
	margin:10px auto;
	height:25px;
	display:none;
}

#bar{
	/* The scroll bar */
	background:url(img/slider_center.png) repeat-x center center;
	height:25px;
	cursor:pointer;
}

#barLeft{
	background:transparent url(img/slider.png) no-repeat scroll left center;
	height:25px;
	width:20px;
	left:0;
	top:0;
	position:absolute;
}

#barRight{
	background:transparent url(img/slider.png) no-repeat scroll right center;
	height:25px;
	position:absolute;
	right:0;
	top:0;
	width:20px;
}

#overlay{
	/* The overlay that darkens the page when an event is clicked */
	position:absolute;
	z-index:10;
	top:0;
	left:0;
	background-color:#222222;
}

#windowBox{
	/* Shows details about the event on click */
	position:absolute;
	z-index:20;
	background-color:#fcfcfc;
	padding:10px;
	border:2px solid #666666;
	overflow:auto;
}

#titleDiv{
	/* The title of the windowBox */
	background:#F5F5F5;
	border:1px solid #EEEEEE;
	color:#AAAAAA;
	font-size:1.5em;
	margin-bottom:10px;
	padding:5px 10px;
}

#date{
	/* The date on the bottom of the windowBox */
	bottom:20px;
	color:#999999;
	font-size:0.8em;
	font-style:italic;
	position:absolute;
	right:15px;
	padding:2px;
	background:#FCFCFC;
}

#highlight{
	/* The blue highlight that moves with the scroll bar */
	height:30px;
	position:absolute;
	z-index:0;
	left:0;
	top:0;
	
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	border-width:0 1px;
}

.clear{
	clear:both;
}

/* The styles below are only necessary for the demo page */

h1{
	background:#F4F4F4;
	border-bottom:1px solid #EEEEEE;
	font-family:"Myriad Pro",Arial,Helvetica,sans-serif;
	font-size:20px;
	font-weight:normal;
	margin-bottom:15px;
	padding:15px;
	text-align:center;
}

h2 {
	font-family:"Myriad Pro",Arial,Helvetica,sans-serif;
	font-size:12px;
	font-weight:normal;
	padding-right:40px;
	position:relative;
	right:0;
	text-align:right;
	text-transform:uppercase;
	top:-48px;
}

a, a:visited {
	color:#0196e3;
	text-decoration:none;
	outline:none;
}

a:hover{
	text-decoration:underline;
}

p.tutInfo{
	/* The tutorial info on the bottom of the page */
	padding:10px 0;
	text-align:center;
	position:absolute;
	bottom:0px;
	background:#F4F4F4;
	border-top:1px solid #EEEEEE;
	width:100%;
}
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/* 
    Created on : Feb 18, 2017, 12:11:54 PM
    Author     : Rodrigo
*/
<div id="timelineLimiter"> <!-- Hides the overflowing timelineScroll div -->
	    <div id="timelineScroll"> <!-- Contains the timeline and expands to fit -->

		
            <div class="event">
                <div class="eventHeading green">Aug 2015</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Segueta 24 dientes paquete 10 unidades 3906-300...</th>
				<th style="text-align:right">0</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Segueta 24 dientes paquete 10 unidades 3906-300...</div>
					<div class="date">August 6, 2015</div>
				</div>
				
				</li><h1>0</h1></ul></div>
            <div class="event">
                <div class="eventHeading blue">Nov 2016</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Guantes Hilaza Neon Puntos PVC 2 Caras</th>
				<th style="text-align:right">280,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Guantes Hilaza Neon Puntos PVC 2 Caras</div>
					<div class="date">November 2, 2016</div>
				</div>
				
				</li><h1>280,000</h1></ul></div>
            <div class="event">
                <div class="eventHeading chreme">Feb 2017</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Espatula Extra Ancha</th>
				<th style="text-align:right">42</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Espatula Extra Ancha</div>
					<div class="date">February 1, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Parasol Lateral 3 m Blanco</th>
				<th style="text-align:right">28</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Parasol Lateral 3 m Blanco</div>
					<div class="date">February 1, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Enfriadores Azul</th>
				<th style="text-align:right">1,800,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Enfriadores Azul</div>
					<div class="date">February 2, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Alambre #8 100 metros amarillo Conectores y Cables</th>
				<th style="text-align:right">0</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Alambre #8 100 metros amarillo Conectores y Cables</div>
					<div class="date">February 2, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Vitaperico1 Kg</th>
				<th style="text-align:right">72</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Vitaperico1 Kg</div>
					<div class="date">February 13, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Varilla 5/8 pulgada x 6 metros cuadrada</th>
				<th style="text-align:right">6,800,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Varilla 5/8 pulgada x 6 metros cuadrada</div>
					<div class="date">February 17, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Escobilla Limpiafondo</th>
				<th style="text-align:right">1,240,000,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Escobilla Limpiafondo</div>
					<div class="date">February 23, 2017</div>
				</div>
				
				</li><h1>1,248,600,142</h1></ul></div>
            <div class="event">
                <div class="eventHeading green">Apr 2017</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Asoleadora Curva Chocolate</th>
				<th style="text-align:right">750,000,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Asoleadora Curva Chocolate</div>
					<div class="date">April 21, 2017</div>
				</div>
				
				</li><h1>750,000,000</h1></ul></div>
            <div class="event">
                <div class="eventHeading blue">Mar 2018</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Llanta 275/55 Rin 20 111S CC LX20</th>
				<th style="text-align:right">400</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Llanta 275/55 Rin 20 111S CC LX20</div>
					<div class="date">March 1, 2018</div>
				</div>
				
				</li><h1>400</h1></ul></div>
            <div class="event">
                <div class="eventHeading chreme">Feb 2019</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Ladrillo hor 3 huecos 9x20x80 9.5k 6.25und/m2</th>
				<th style="text-align:right">336,002,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Ladrillo hor 3 huecos 9x20x80 9.5k 6.25und/m2</div>
					<div class="date">February 1, 2019</div>
				</div>
				
				</li><h1>336,001,664</h1></ul></div>	    
        <div class="clear"></div>
        </div>
        
        <div id="scroll"> <!-- The year time line -->
            <div id="centered"> <!-- Sized by jQuery to fit all the years -->
	            <div id="highlight"></div> <!-- The light blue highlight shown behind the years -->
	            <div class="scrollPoints">Aug 2015</div><div class="scrollPoints">Nov 2016</div><div class="scrollPoints">Feb 2017</div><div class="scrollPoints">Apr 2017</div><div class="scrollPoints">Mar 2018</div><div class="scrollPoints">Feb 2019</div> <!-- This PHP variable holds the years that have events -->
                <div class="clear"></div>
            </div>
        </div>
        
        <div id="slider"> <!-- The slider container -->
        	<div id="bar"> <!-- The bar that can be dragged -->
            	<div id="barLeft"></div>  <!-- Left arrow of the bar -->
                <div id="barRight"></div>  <!-- Right arrow, both are styled with CSS -->
          </div>
        </div>
        
    </div> 

  	
</div>
</body>
</html>

    /* The number of event sections / years with events */
    var tot=$('.event').length;

    $('.eventList li').click(function(e){
            showWindow('<div>'+$(this).find('div.content').html()+'</div>');
    });

    /* Each event section is 320 px wide */
    var timelineWidth = 320*tot;
    var screenWidth = $(document).width();

    $('#timelineScroll').width(timelineWidth);

    /* If the timeline is wider than the screen show the slider: */
    if(timelineWidth > screenWidth)
    {
        $('#scroll,#slider').show();
        $('#centered,#slider').width(120*tot);

        /* Making the scrollbar draggable: */
        $('#bar').width((120/320)*screenWidth).draggable({

            containment: 'parent',
            drag: function(e, ui) {

                if(!this.elem)
                {
                    /* This section is executed only the first time the function is run for performance */

                    this.elem = $('#timelineScroll');

                    /* The difference between the slider's width and its container: */
                    this.maxSlide = ui.helper.parent().width()-ui.helper.width();

                    /* The difference between the timeline's width and its container */
                    this.cWidth = this.elem.width()-this.elem.parent().width();
                    this.highlight = $('#highlight');
                }

                /* Translating each movement of the slider to the timeline: */
                this.elem.css({marginLeft:'-'+((ui.position.left/this.maxSlide)*this.cWidth)+'px'});

                /* Moving the highlight: */
                this.highlight.css('left',ui.position.left)
            }
        });

        $('#highlight').width((120/320)*screenWidth-3);
    }

});

为什么会导致这个问题?

最佳答案

您的#bar 存在位置问题。 我没有时间考虑太多来找出如何正确解决它,但如果你知道问题出在哪里,你会发现解决方案更容易。

将这些样式添加到#bar 并检查。

background: rgba(255,0,0,0.2); /* make it partially visible to track */
z-index:999;  /* make it on top of others */
margin-top: -40px;  /* workaround for y positioning problem */

以下是已应用解决方法的代码:

$(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */

    /* The number of event sections / years with events */
    var tot=$('.event').length;

    $('.eventList li').click(function(e){
            showWindow('<div>'+$(this).find('div.content').html()+'</div>');
    });

    /* Each event section is 320 px wide */
    var timelineWidth = 320*tot;
    var screenWidth = $(document).width();

    $('#timelineScroll').width(timelineWidth);

    /* If the timeline is wider than the screen show the slider: */
    if(timelineWidth > screenWidth)
    {
        $('#scroll,#slider').show();
        $('#centered,#slider').width(120*tot);

        /* Making the scrollbar draggable: */
        $('#bar').width((120/320)*screenWidth).draggable({

            containment: 'parent',
            drag: function(e, ui) {

                if(!this.elem)
                {
                    /* This section is executed only the first time the function is run for performance */

                    this.elem = $('#timelineScroll');

                    /* The difference between the slider's width and its container: */
                    this.maxSlide = ui.helper.parent().width()-ui.helper.width();

                    /* The difference between the timeline's width and its container */
                    this.cWidth = this.elem.width()-this.elem.parent().width();
                    this.highlight = $('#highlight');
                }

                /* Translating each movement of the slider to the timeline: */
                this.elem.css({marginLeft:'-'+((ui.position.left/this.maxSlide)*this.cWidth)+'px'});

                /* Moving the highlight: */
                this.highlight.css('left',ui.position.left)
            }
        });

        $('#highlight').width((120/320)*screenWidth-3);
    }

});
body,h1,h2,h3,p,quote,small,form,input,ul,li,ol,label{
	/* Simple page reset */
	margin:0;
	padding:0;
}

body{
	/* Setting default text color, background and a font stack */
	color:#555555;
	font-size:0.825em;
	background: #fcfcfc;
	font-family:Arial, Helvetica, sans-serif;
}

.event{
	/* Contains the event header and body list */
	float:left;
	padding:4px;
	text-align:left;
	width:300px;
	margin:0 5px 50px;
}

.eventList li{
	/* The individual events */
	background:#F4F4F4;
	border:1px solid #EEEEEE;
	list-style:none;
	margin:5px;
	padding:4px 7px;
	
	/* CSS3 rounded corners */
	-moz-border-radius:4px;
	-webkit-border-radius:4px;
	border-radius:4px;
}

.eventList li:hover{
	/* The hover state: */
	cursor:pointer;
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	color:#548DA5;
}

li span{
	/* The event icon */
	display:block;
	float:left;
	height:16px;
	margin-right:5px;
	width:16px;
}

/* Individual background images for each type of event: */

li.news span.icon { 	background:url(img/icons/newspaper.png) no-repeat; }
li.image span.icon { 	background:url(img/icons/camera.png) no-repeat; }
li.milestone span.icon { 	background:url(img/icons/chart.png) no-repeat; }

div.content{
	/* This div contains additional data for the content */
	display:none;
}

.eventHeading{
	/* The colorful year headings at the top */
	font-size:2em;
	margin:-5px -5px 10px;
	padding:2px 5px;
	text-align:center;
}

/* Three color styles for the headings: */

.eventHeading.chreme{
	background:#FBF7F0;
	border:1px solid #EEE4D4;
	color:#A78B5F;
}

.eventHeading.blue{
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	color:#548DA5;
}

.eventHeading.green{
	background:#E6FFDF none repeat scroll 0 0;
	border:1px solid #C9E6C1;
	color:#6EA85F;
}

#timelineLimiter{
	/* Hides the overflowing timeline */
	width:100%;
	overflow:hidden;
	padding-top:10px;
	margin:40px 0;
}

#scroll{
	/* The small timeline below the main one. Hidden here and shown by jQuery if JS is enabled: */
	display:none;
	height:30px;

	background:#F5F5F5;
	border:1px solid #EEEEEE;
	color:#999999;
}

.scrollPoints{
	/* The individual years */
	float:left;
	font-size:1.4em;
	padding:4px 10px;
	text-align:center;
	width:100px;
	
	position:relative;
	z-index:10;
}

#centered{
	/* Centers the years, width is assigned by jQuery */
	margin:0 auto;
	position:relative;
}

#slider{
	/* Holds the scroll bar */
	margin:10px auto;
	height:25px;
	display:none;
}

#bar{
	/* The scroll bar */
	background:url(img/slider_center.png) repeat-x center center;
	height:25px;
	cursor:pointer;

  background: rgba(255,0,0,0.2); /* make it partially visible to track */
  z-index:999;  /* make it on top of others */
  margin-top: -40px;  /* workaround for y positioning problem */  

}

#barLeft{
	background:transparent url(img/slider.png) no-repeat scroll left center;
	height:25px;
	width:20px;
	left:0;
	top:0;
	position:absolute;
}

#barRight{
	background:transparent url(img/slider.png) no-repeat scroll right center;
	height:25px;
	position:absolute;
	right:0;
	top:0;
	width:20px;
}

#overlay{
	/* The overlay that darkens the page when an event is clicked */
	position:absolute;
	z-index:10;
	top:0;
	left:0;
	background-color:#222222;
}

#windowBox{
	/* Shows details about the event on click */
	position:absolute;
	z-index:20;
	background-color:#fcfcfc;
	padding:10px;
	border:2px solid #666666;
	overflow:auto;
}

#titleDiv{
	/* The title of the windowBox */
	background:#F5F5F5;
	border:1px solid #EEEEEE;
	color:#AAAAAA;
	font-size:1.5em;
	margin-bottom:10px;
	padding:5px 10px;
}

#date{
	/* The date on the bottom of the windowBox */
	bottom:20px;
	color:#999999;
	font-size:0.8em;
	font-style:italic;
	position:absolute;
	right:15px;
	padding:2px;
	background:#FCFCFC;
}

#highlight{
	/* The blue highlight that moves with the scroll bar */
	height:30px;
	position:absolute;
	z-index:0;
	left:0;
	top:0;
	
	background:#E6F8FF;
	border:1px solid #D4E6EE;
	border-width:0 1px;
}

.clear{
	clear:both;
}

/* The styles below are only necessary for the demo page */

h1{
	background:#F4F4F4;
	border-bottom:1px solid #EEEEEE;
	font-family:"Myriad Pro",Arial,Helvetica,sans-serif;
	font-size:20px;
	font-weight:normal;
	margin-bottom:15px;
	padding:15px;
	text-align:center;
}

h2 {
	font-family:"Myriad Pro",Arial,Helvetica,sans-serif;
	font-size:12px;
	font-weight:normal;
	padding-right:40px;
	position:relative;
	right:0;
	text-align:right;
	text-transform:uppercase;
	top:-48px;
}

a, a:visited {
	color:#0196e3;
	text-decoration:none;
	outline:none;
}

a:hover{
	text-decoration:underline;
}

p.tutInfo{
	/* The tutorial info on the bottom of the page */
	padding:10px 0;
	text-align:center;
	position:absolute;
	bottom:0px;
	background:#F4F4F4;
	border-top:1px solid #EEEEEE;
	width:100%;
}
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/* 
    Created on : Feb 18, 2017, 12:11:54 PM
    Author     : Rodrigo
*/
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<div id="timelineLimiter"> <!-- Hides the overflowing timelineScroll div -->
	    <div id="timelineScroll"> <!-- Contains the timeline and expands to fit -->

		
            <div class="event">
                <div class="eventHeading green">Aug 2015</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Segueta 24 dientes paquete 10 unidades 3906-300...</th>
				<th style="text-align:right">0</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Segueta 24 dientes paquete 10 unidades 3906-300...</div>
					<div class="date">August 6, 2015</div>
				</div>
				
				</li><h1>0</h1></ul></div>
            <div class="event">
                <div class="eventHeading blue">Nov 2016</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Guantes Hilaza Neon Puntos PVC 2 Caras</th>
				<th style="text-align:right">280,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Guantes Hilaza Neon Puntos PVC 2 Caras</div>
					<div class="date">November 2, 2016</div>
				</div>
				
				</li><h1>280,000</h1></ul></div>
            <div class="event">
                <div class="eventHeading chreme">Feb 2017</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Espatula Extra Ancha</th>
				<th style="text-align:right">42</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Espatula Extra Ancha</div>
					<div class="date">February 1, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Parasol Lateral 3 m Blanco</th>
				<th style="text-align:right">28</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Parasol Lateral 3 m Blanco</div>
					<div class="date">February 1, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Enfriadores Azul</th>
				<th style="text-align:right">1,800,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Enfriadores Azul</div>
					<div class="date">February 2, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Alambre #8 100 metros amarillo Conectores y Cables</th>
				<th style="text-align:right">0</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Alambre #8 100 metros amarillo Conectores y Cables</div>
					<div class="date">February 2, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Vitaperico1 Kg</th>
				<th style="text-align:right">72</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Vitaperico1 Kg</div>
					<div class="date">February 13, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Varilla 5/8 pulgada x 6 metros cuadrada</th>
				<th style="text-align:right">6,800,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Varilla 5/8 pulgada x 6 metros cuadrada</div>
					<div class="date">February 17, 2017</div>
				</div>
				
				</li><li class=""><table><tr>
				<th>Escobilla Limpiafondo</th>
				<th style="text-align:right">1,240,000,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Escobilla Limpiafondo</div>
					<div class="date">February 23, 2017</div>
				</div>
				
				</li><h1>1,248,600,142</h1></ul></div>
            <div class="event">
                <div class="eventHeading green">Apr 2017</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Asoleadora Curva Chocolate</th>
				<th style="text-align:right">750,000,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Asoleadora Curva Chocolate</div>
					<div class="date">April 21, 2017</div>
				</div>
				
				</li><h1>750,000,000</h1></ul></div>
            <div class="event">
                <div class="eventHeading blue">Mar 2018</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Llanta 275/55 Rin 20 111S CC LX20</th>
				<th style="text-align:right">400</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Llanta 275/55 Rin 20 111S CC LX20</div>
					<div class="date">March 1, 2018</div>
				</div>
				
				</li><h1>400</h1></ul></div>
            <div class="event">
                <div class="eventHeading chreme">Feb 2019</div>
                <ul class="eventList">
                <li class=""><table><tr>
				<th>Ladrillo hor 3 huecos 9x20x80 9.5k 6.25und/m2</th>
				<th style="text-align:right">336,002,000</th>
				</table></tr>
				<div class="content">
                                
					<div class="body"></div>
					<div class="producto">Ladrillo hor 3 huecos 9x20x80 9.5k 6.25und/m2</div>
					<div class="date">February 1, 2019</div>
				</div>
				
				</li><h1>336,001,664</h1></ul></div>	    
        <div class="clear"></div>
        </div>
        
        <div id="scroll"> <!-- The year time line -->
            <div id="centered"> <!-- Sized by jQuery to fit all the years -->
	            <div id="highlight"></div> <!-- The light blue highlight shown behind the years -->
	            <div class="scrollPoints">Aug 2015</div><div class="scrollPoints">Nov 2016</div><div class="scrollPoints">Feb 2017</div><div class="scrollPoints">Apr 2017</div><div class="scrollPoints">Mar 2018</div><div class="scrollPoints">Feb 2019</div> <!-- This PHP variable holds the years that have events -->
                <div class="clear"></div>
            </div>
        </div>
        
        <div id="slider"> <!-- The slider container -->
        	<div id="bar"> <!-- The bar that can be dragged -->
            	<div id="barLeft"></div>  <!-- Left arrow of the bar -->
                <div id="barRight"></div>  <!-- Right arrow, both are styled with CSS -->
          </div>
        </div>
        
    </div> 

  	
</div>
</body>
</html>

关于javascript - JS 滚动条不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42332633/

相关文章:

javascript - 如何获取 Neo4j Node 的属性

javascript - 将不透明度更改切换为复选框图像

javascript - 值控制的颜色不透明度

javascript - 在 javascript 中解析 JSON 对象(键/值对)

javascript - Bootstrap 导航栏折叠 - 如何通过点击关闭

javascript - 在特定位置处理 Android 后退按钮 - Cordova/Phonegap

javascript - 如何在 html 表格中变灰

jquery - 如何用背景颜色覆盖相对定位的div

css - 防止在 Chrome 中突出显示 Canvas 区域

html - 如何在垂直导航栏中分隔 <li> 元素(菜单)