不知道你能不能看到了,今天我也碰到这个需求了,主要利用left属性,实现了左侧的效果,如下:
$(".zoom_left").mousedown(function(h) { var g = $(this); var h = event || window.event; h.stopPropagation(); var f = parseInt(g.parent().css("width")); var left = parseInt(g.parent().css("left")); var d = { x: h.clientX, y: h.clientY }; window.onmousemove = function(i) { var i = event || window.event; g.parent().css("left", left - (d.x - i.clientX)); g.parent().css("width", f + d.x - i.clientX); }; window.onmouseup = function(i) { var i = event || window.event; window.onmousemove = null } });