具体代码如下所示:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> .dragAble { position: relative; cursor: move; } .img-con { position: relative; width: 713px; height: 455px; overflow: hidden; border: 1px solid red; } </style> </head> <body> <p class="img-con"><img src="/UploadFiles/2021-04-02/sy_20110714135215645030.jpg">只缩放
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <img border="0" src="/UploadFiles/2021-04-02/sy_20110714135215645030.jpg">总结
以上所述是小编给大家介绍的JS滚轮控制图片缩放大小和拖动的实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!