"honest horizontal scrolling" - we drag an invisible window behind the mouse, with an internal height equal to the internal width of what we will scroll horizontally. http://jsfiddle.net/oceog/DcyWD/
CSS:
#pass { position: fixed; top: 0px; width: 1px; height: 1px; background: black; opacity: 0; overflow-x: scroll; z-index: 10000; } #inner { height: 10000px; } #text { width: 10000px; }
Js:
var pass=$('#pass'); //пропускаем нажатия мыши, чтобы можно было выделять текст pass.mousedown(function(e) { console.log(e); $this=$(this); $this.css('z-index','-1000'); $('document').trigger(e); $(document).mouseup(function(e) { console.log(e); $this.css('z-index','1000'); }) }); $(document).mousemove(function(e,d){ pass.css('top',e.clientY); pass.css('left',e.clientX); }) pass.scroll(function(){ console.log(pass.scrollTop()); $('body').scrollLeft(pass.scrollTop()); })
another example, something similar - turning the vertical position of an element into css attributes
http://jsfiddle.net/oceog/QrWSb/
I tested both examples only in chrome, I think there’s still a problem with the zoom, maybe