I might also have mentioned that scripts that do deal with this usually are displaying smaller items, like a tool tip for instance. Even then, when the browser window becomes narrow and/or short, the effect is still less than ideal. But, as promised, here is one script that does do this:
http://www.dynamicdrive.com/dynamici...oontooltip.htm
particularly in its section here:
Code:
function clearbrowseredge(obj, whichedge){
if (whichedge=="rightedge"){
edgeoffsetx=0
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffsetx=dropmenuobj.contentmeasure-obj.offsetWidth
return edgeoffsetx
}
else{
edgeoffsety=0
var topedge=ie && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) //move up?
edgeoffsety=dropmenuobj.contentmeasure+obj.offsetHeight+(verticaloffset*2)
return edgeoffsety
}
}
It should be noted that the above function is used by other code in its script, so is not totally complete in and of itself, but it shows one approach to getting the window dimensions and reporting them back to a positioning function for further use. You may view the above code's full script at:
http://www.dynamicdrive.com/dynamicindex5/balloontip.js
If after going over this and the other resources I mentioned, you have some added code for the script you want to use but are having trouble with it, give me a link to a demo of it and I will see what I can do.
Bookmarks