当前位置:首页 >> 网络编程

jQuery实现的支持IE的html滑动条

复制代码 代码如下:
<html>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.js"> <style>
.d_b{
    height: 20px;
    width: 10px;
    display: inline-block;
    background-color: black;
    position: relative;
    vertical-align: middle;
    top: -15px;
    left: -5px;
}
</style>
<div id="d" style="width:200px;cursor: pointer;" max=100 min=0 value=10 >
<div style="height:10px; width:100%; background-color:green" ></div>
<b class="d_b"></b>
</div>
<b id="text"></b>
<script>
var $dom = $(document);
$dom.on('mousedown','#d',function (argument) {
    $(this).data('mouse','down');
    console.log('down');
})
$dom.on('mouseup',function(){
    $('#d').data('mouse','up');
    console.log('up');
});
$dom.on('mousemove','#d',function(event){
    if($(this).data('mouse') == 'down'){
        var m_x = event.clientX;
        var d_b = $(this).find('.d_b');
        m_x = m_x < 8 "" src="/UploadFiles/2021-04-02/2015031611021614.png">

以上就是本文的全部内容了,希望能够对大家学习使用jQuery有所帮助。