javascript - scrollBy doesn't work in Firefox and Opera -
this scrollby function works in internet explorer, ignores firefox , opera. can solve problem?
function scrollleft(s){ document.frames['my_iframe'].scrollby(-s,0); window.frames['my_iframe'].scrollby(-s,0); } function scrollright(s){ document.frames['my_iframe'].scrollby(s,0); window.frames['my_iframe'].scrollby(s,0); } here example works in internet explorer browser, doesn't work in firefox , opera: http://igproject.ru/iframe-scrolling/index.htm
in firefox, etc. need use scrollto() instead of scrollby().
see: http://jsfiddle.net/4ckml/
example:
window.scrollto(50,50); you cannot use scrollto/by if domains don't match. can see here javascript error produced:
permission denied access property 'scrollto'
edit - updating answer incorporate answer long comment chain:
var oif = document.getelementbyid('my_iframe').contentwindow; oif.scrollby(s, 0);
Comments
Post a Comment