Ich arbeite derzeit an einem Projekt, wo ich einen bestimmten Abschnitt auf der Grundlage der Bewegung von Eingangstyp = Bereich scrollen muss. Dies ist die Code-Scrollen Sie einen Div mit Javascript + Eingabe Typ = Bereich
$('input[type=range]').val('0');
$('input[type=range]').on('change input', function() {
\t var max = 60;
\t var value = $(this).val();
\t var percent = value/max;
var height = $('.tooltip').height();
console.log("v",value);
var top = value + "%";
console.log("t",top);
\t $('.tooltip').css('top', top);
})
.tooltip {
position: absolute;
left: 0;
background: silver;
border-left: dotted 2px orange;
padding: 2px;
max-width: 200px;
text-align: center;
}
input[type=range] {
margin-top: 50px;
width: 100%;
}
input[type=range]::-webkit-slider-thumb:after {
content: '';
width: 100px;
background: transparent;
color: #000;
border-left: dotted 2px orange;
pointer-events: none;
padding: 50px;
position: relative;
top: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div style="height:250px;position:relative;border:2px solid;width:200px;overflow:hidden;">
<div class="tooltip">
<p>How can I get this border to <em>consistently</em> align with the one on the thumb?</p>
</div>
</div>
<input type="range" min="0" max="100"/>
- here is the working. Aber das Problem ist, sobald ich scrollen bis zu 100% der Scroll-Div geht über die äußere div. Ich möchte, dass das scrollende div am Ende des äußeren divs stoppt, auch wenn der Bereich auf 100% steht (das scrollende diov sollte das äußere div nicht überschreiten). Danke im Voraus.
ist mir max 100 se kam kar lou Dost –