嗨,我有一个情况,我使用jquery slim滚动插件与jquery sortable.问题是当我将项目从一个列表项目拖动到另一个列表项目时,右侧的滚动条不会随之移动,所以如果我必须将列表放到最后一个列表项目区域,除非我使用鼠标滚轮,否则我不能去那里.那么当我将项目从一个列表区域拖动到另一个列表区域时,如何绑定滚动条位置.以下是代码 -
$(function() {
$("ul.droptrue").sortable({
revert: 'invalid',
connectWith: "ul"
});
$("#sortable1, #sortable2, #sortable3").disableSelection();
$('.ScrollableAreanew ').slimScroll({
height: '400',
width: '100%',
alwaysVisible: true,
color: 'rgb(15,170,255)',
railOpacity: 1,
opacity: 1,
size: '5px',
position: 'right',
allowPageScroll: false,
});
});Run Code Online (Sandbox Code Playgroud)
#sortable1,
#sortable2,
#sortable3 {
list-style-type: none;
margin: 0;
float: left;
margin-right: 10px;
background: #eee;
padding: 5px;
width: 100%;
margin-bottom: 10px;
}
#sortable1 li,
#sortable2 li,
#sortable3 li {
margin: 5px;
padding: 5px;
font-size: 1.2em;
width: 100%;
border: 1px …Run Code Online (Sandbox Code Playgroud)我如何修复下面的代码..我使用了transform:translateY(-50%)的技术使div垂直居中.但是当我将它与动画一起使用时,它首先需要top:50%它翻译给一个混蛋 ..我不希望这个混蛋发生,元素应该自动进入中心.
body,
html {
height: 100%;
background: #c9edff;
text-align: center;
}
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
font-family: arial;
font-size: 20px;
line-height: 1.8em;
-webkit-animation-name: zoom;
-webkit-animation-duration: 0.6s;
animation-name: zoom;
animation-duration: 0.6s;
}
@-webkit-keyframes zoom {
from {
-webkit-transform: scale(0);
}
to {
-webkit-transform: scale(1)
}
}
@keyframes zoom {
from {
transform: scale(0)
}
to {
transform: scale(1)
}
}Run Code Online (Sandbox Code Playgroud)
<div class="element">
Vertical Align is Awesome!
<br /> But with …Run Code Online (Sandbox Code Playgroud)我有两个同类的div.如果我滚动一个div,其他divs滚动到0.我能够轻松实现.prop()属性.但是当我使用.animate()时,事件只发生一次然后它停止工作(在我的示例代码段中对代码进行了评论).我想要的是滚动到零时应该动画,即滚动到0,动画就像用.animate()显示.
注意:div的类别是相同的,也可以有更多的div.
这是我试过的代码,请告诉我哪里错了.
$(document).ready(function() {
$('.swipe_div').scroll(function() {
// $(this).siblings(".swipe_div").animate({scrollLeft: 0},100);
$(this).siblings(".swipe_div").prop({
scrollLeft: 0
});
});
});Run Code Online (Sandbox Code Playgroud)
body,
html {
width: 100%;
height: 100%;
background-color: green;
padding: 0;
margin: 0;
}
.swipe_div {
display: block;
float: left;
width: 100%;
height: 100px;
overflow-x: scroll;
background-color: white;
}
.content,
.operation,
.swipe_container {
display: block;
float: left;
height: 100%;
}
.swipe_container {
width: 150%;
}
.content {
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: row;
text-align: right;
font-size: 30pt;
width: 67%;
background-color: grey; …Run Code Online (Sandbox Code Playgroud)对此进行了大量搜索,但基于chart.js对此没有任何答案。我已经在这里问过这个问题,我在其中使用highchart.js并获得了解决方案,但现在我正在使用chart.js库并试图找到解决方案。以下是我尝试过的代码。我需要找到这两个折线图组合之间的交点。参见图形图像。

var config = {
type: 'bar',
data: {
labels: ["Year 0", "Year 1", "Year 2", "Year 3", "Year 4", "Year 5", "Year 6"],
datasets: [{
type: 'line',
label: 'Cost',
data: [150, 15, 25, 14, 10, 7],
borderColor: '#E35500',
fill: false,
lineTension: 0,
borderJoinStyle: 'miter',
}, {
type: 'line',
label: 'Cash Flow',
data: [20, 180, 170, 220, 160, 190],
borderColor: '#FFC000',
fill: false,
lineTension: 0,
borderJoinStyle: 'miter',
xAxes: [{
barPercentage: 0.4
}]
},
{
type: 'line',
label: 'Accumulative …Run Code Online (Sandbox Code Playgroud)我正在使用chart.js库,但遇到了问题。我希望年份轴从0开始。现在从负值开始(在我的情况下为-50)。
我正在尝试-
var config = {
type: 'bar',
data: {
labels: ["Year 0", "Year 1", "Year 2", "Year 3", "Year 4", "Year 5", "Year 6"],
datasets: [{
type: 'line',
label: 'Accumulative Flow',
data: [0, -50, 20, 30, 40, 50],
borderColor: 'red',
fill: false,
lineTension: 0,
borderJoinStyle: 'miter',
xAxes: [{
barPercentage: 0.4
}]
}, {
type: 'bar',
label: 'Benifit(One time)',
backgroundColor: "#005998",
data: [40, 50, 60, 80, 50, 60],
}, ]
},
options: {
title: {
display: true,
text: …Run Code Online (Sandbox Code Playgroud)