<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>This is what I have so far. I think it's stable, but I'd have to try it for a while to be sure. The 200 is also kind of arbitrary.

&lt;pre&gt;
        const right = document.body.clientWidth - event.pageX;

	tip.style.right = '';
	if(right &lt; 200)
		tip.style.right = right + TIP_X_OFFSET + 'px';
	else{
	        tip.style.left = event.pageX + TIP_X_OFFSET + 'px';}
&lt;/pre&gt;</body>
  <body-html>&lt;p&gt;This is what I have so far. I think it's stable, but I'd have to try it for a while to be sure. The 200 is also kind of arbitrary.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
        const right = document.body.clientWidth - event.pageX;

	tip.style.right = '';
	if(right &amp;lt; 200)
		tip.style.right = right + TIP_X_OFFSET + 'px';
	else{
	        tip.style.left = event.pageX + TIP_X_OFFSET + 'px';}
&lt;/pre&gt;&lt;/p&gt;</body-html>
  <created-at type="datetime">2009-03-01T21:49:58Z</created-at>
  <forumable-id type="integer">39393</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">99343</id>
  <topic-id type="integer">21519</topic-id>
  <updated-at type="datetime">2009-03-01T21:51:23Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">64431</user-id>
</post>
