internet explorer - Javascript window.scrollTo Behavior On Different Browsers -
I am facing a problem with scroll to function when there is a dir = rtl feature in my body here Is for.
HTML:
window.scrollTo (-200, 0);
& lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body dir = "rtl" & gt; & Lt; Div width = "100%" style = "width: 3000px; height: 200px; overflow: hidden" & gt; & Lt; Div style = "width: 1000px; height: 100px; range: 2px solid black; display: inline-block" & gt; & Lt; / Div & gt; & Lt; Div style = "width: 1000px; height: 100px; range: 2px solid red; display: inline-block" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Window.scrollTo (-200, 0); & Lt; / Script & gt; & Lt; / Body & gt; If I pass a positive value for the xpos parameter, then it normally works on IE (type) it scrolls to the right of the screen for the amount of 200px, but it does not work on Chrome and Firefox. , I hope that to work, one has to give a negative value for scrolling. My question is how can I handle this code in my code, what should I do to sniff the browser? Or is there a better way? Can I test some features if it is supported?
Implementation for 3 main horizontal scrolling in its jQuery RTL Scroll Type plugin when dir
is set to rtl
: WebKit, Firefox / Opera and IE
The difference between these implementations is as follows:
Because you can not use jQuery, I've modified the author code and this is Chrome, Firefox and IE EE works well in 11
Comments
Post a Comment