Yes, you could probably do that. It hasn't bothered me that much so I haven't looked into it myself.
To make changes to this plugin you have to:
- Uncomment line 281 in
ajaxtranslation.php so that it loads the uncompressed version of
- Comment out the second section of
jquery.translate-1.3.9.min.js so that it doesn't load that.
- Make your changes to
The logic works something like this:
First decide if you want the popup to stay within the window or the page, two different things.
When the popup is hidden the browser doesn't know how tall it is. It could have anywhere from 1 to 43 languages and the font size changes the size of the box, so it has to be shown first and then it has a specific height after that. That prevents you from using the slideDown animation but you could use a fadeIn.
So, show the popup first and find out how tall it is and where the bottom edge is.
If the bottom edge of the popup is past the bottom of the page (or window) put the popup above the "Translate" button.
Then if the top edge of the popup is above the top of the page (or window) put the popup back below the "Translate" button.
Something like that... from what I've read.