Quote:
Originally Posted by cheesegrits
3) There's a bug with vb's dropdown menus. As I click on them, they got displayed away from menu (see pic).
This is a semi-well known quirk of vB's menu control javascript. It assumes there are no blocks on the page between the menu location and the document root which use 'position=absolute' or 'position=relative'. In other words, vB always assumes it is calculating coordinates relative to the top left of the document. But if the menu is within any block which uses positioning (like your J! template), it is then rendered with the coordinates being relative to that block. So the menu is shifted down and to the right.
The only cure I've found for this is a vB file edit, which I hate doing, but I've yet to find a workaround for it. In ./clientscript/vbulletin_menu.js, edit the following function to look like this:
Code:
vB_Popup_Menu.prototype.fetch_offset = function(obj)
{
/*
if (obj.getBoundingClientRect)
{
// better, more accurate function for IE
var rect = obj.getBoundingClientRect();
var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
if (document.documentElement.dir == 'rtl')
{
// IE returns a positive scrollLeft, but we need a negative value to actually do proper calculations.
// This actually flips the scolloing to be relative to the distance scrolled from the default.
scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth;
}
return { 'left' : rect.left + scrollLeft, 'top' : rect.top + scrollTop };
}
*/
var left_offset = obj.offsetLeft;
var top_offset = obj.offsetTop;
while (YAHOO.util.Dom.getStyle(obj, 'position') == 'static' && (obj = obj.offsetParent) != null)
{
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}
return { 'left' : left_offset, 'top' : top_offset };
};
As always with code edits, make sure you keep an original copy of the file in case you moof it up.
-- hugh
|
those changes didn't seem to work for me. after making the change, the dropdown menu fails to appear at all, and it logs an error, "Error: 'YAHOO' is undefined"
i noticed that on shadowraith's site (
http://crimsonshadows.net/forum), he has the same problem with the dropdowns, too.
any other suggestions would be greatly appreciated.