南强小屋 Design By 杰米
尝试模仿京东的“发现好货”模块的可用滑块滑动的缓动图
JS代码
function $(id) { return document.getElementById(id); } //缓动轮播图 var fhTimer; var fhNum = 0; var barNum = 0; fhTimer = setInterval(marquee, 20); function marquee() { fhNum--; barNum = fhNum; if(fhNum < -2400) { fhNum = 0; } $("fhc_ul").style.left = fhNum + "px"; if(fhNum < -2400) { barNum = fhNum + 2400; } $("fhc_dBar").style.left = -(barNum / 2.75) + "px"; } $("fhcShow").onmouseover = function() { $("fhc_d_box").style.display = "block"; clearInterval(fhTimer); } $("fhc_d_box").onmouseover = function() { $("fhc_d_box").style.display = "block"; } $("fhcShow").onmouseout = function() { $("fhc_d_box").style.display = "none"; fhTimer = setInterval(marquee, 20); } //鼠标悬浮在标题也在暂停滚动 $("fhTit").onmouseover = function() { clearInterval(fhTimer); } $("fhTit").onmouseout = function() { fhTimer = setInterval(marquee, 20); } //滑块 $("fhc_dBar").onmousedown = function(event) { var event = event || window.event; var leftValue = event.clientX - this.offsetLeft; document.onmousemove = function(event) { var evt = event || window.event; var locationX = evt.clientX - leftValue; if(locationX < 0) { locationX = 0; } else if(locationX > 960 - 99) { locationX = 960 - 99; } $("fhc_dBar").style.left = locationX + "px"; fhNum = -locationX * 2.75; //如果选中了,就取消选中,防止出现bug window.getSelection "htmlcode"><div class="fxhh_ctt"> <div class="fh_c_show" id="fhcShow"> <ul class="fh_c_under" id="fhc_ul"> <li><a href=" " rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" > <p class="topTit">商品1</p> <img src="/UploadFiles/2021-04-02/">总结
以上所述是小编给大家介绍的JS实现可用滑块滑动的缓动图代码,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!
标签:
js,滑块滑动,js,缓动图
南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米
暂无JS实现可用滑块滑动的缓动图代码的评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。