Jump to content


Photo

window.moveBy method: problem with Opera ?


  • Please log in to reply
1 reply to this topic

#1 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 02 May 2006 - 08:30 AM

Hi all,,

erfff,, an other compatibility problem between navigators,... it seems the method 'window.moveBy' doesn't work with Opera,

Any tips/links/comments about,... I've searched on yahoo/google but most of the answers/topics are not relevant, or are in german... :)

Thanks in advance,,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 04 May 2006 - 10:44 AM

I've fixed that one,,
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
if (browser.isIE) // IE & not supported by Opera
{
x = window.event.clientX + document.documentElement.scrollLeft+ document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop+ document.body.scrollTop;
}
else // some other browsers
{
x = event.clientX + window.scrollX; // not supported too by Opera
y = event.clientY + window.scrollY;
}
[/quote]
At this point & using Opera, x & y values are still not numbers value,... lines needed:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
// lines to add for Opera:
if (isNaN(x)) // opera
{
x= event.clientX;
y= event.clientY;
}
[/quote]
& window.moveBy now works with Opera,, :)

solved,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users