locked
IMNRC and known bug when scrolling RRS feed

  • Question

  • When using the MS ActiveX control named NameCtrl in an aspx page to show the Office Communicator Server "presence" icon and functionality there is a known bug. Namely that when the user scrolls up or down the page, the popup that appears when hovering over the icon moves all over the place.

    This article cites the issue:One weird bug I've noticed is the roll-over menu on the LCS pawn seems to break as you scroll down the page.  The roll-over menu appears below the actual entry and moves further down the page the more you scroll.  Very strange - still haven't found a fix for it yet.

    Is there a DEFINITIVE fix for this yet please? Does for example Sharepoint 2010 solve this issue. Or can somebody supply the Javascript to always correct the issue.

    My Javascript functions are as follows:

                InitializeObject();
                function InitializeObject() {
                    NameObj = new ActiveXObject("Name.NameCtrl");
                }
                function ShowOOUI(name) {
                    var obj = window.event.srcElement;
                    var y = getY(obj);
                    var x = getX(obj);
                    NameObj.ShowOOUI(name, 0, x, y);
                }
                function HideOOUI() {
                    NameObj.HideOOUI();
                }
    
                function getY(oElement) {
                    var iReturnValue = 0;
                    while (oElement != null) {
                        iReturnValue += (oElement.offsetTop - document.body.parentNode.scrollTop);;
                        oElement = oElement.offsetParent;
                    }
                    return iReturnValue;
                }
    
                function getX(oElement) {
                    var iReturnValue = 0;
                    while (oElement != null) {
                        iReturnValue += (oElement.offsetLeft - document.body.parentNode.scrollLeft);
    ;
                        oElement = oElement.offsetParent;
                    }
                    return iReturnValue;
                }
    • Moved by Peter Jausovec Friday, November 6, 2009 4:43 PM Moving to appropriate forum. (From:SharePoint Development)
    Friday, November 6, 2009 12:00 PM

Answers

  • This is now fixed by subtracting the scrollTop and scrollLeft from the return values of getY and getX respectively.

                InitializeObject();
                function InitializeObject() {
                    NameObj = new ActiveXObject("Name.NameCtrl");
                }
                function ShowOOUI(name) {
                    var obj = window.event.srcElement;
                    var y = getY(obj) - document.body.parentNode.scrollTop; 
                    var x = getX(obj) - document.body.parentNode.scrollLeft; 
                    NameObj.ShowOOUI(name, 0, x, y);
                }
                function HideOOUI() {
                    NameObj.HideOOUI();
                }
    
                function getY(oElement) {
                    var iReturnValue = 0;
                    while (oElement != null) {
                        iReturnValue += oElement.offsetTop; ;
                        oElement = oElement.offsetParent;
                    }
                    return iReturnValue;
                }
    
                function getX(oElement) {
                    var iReturnValue = 0;
                    while (oElement != null) {
                        iReturnValue += oElement.offsetLeft;
                        oElement = oElement.offsetParent;
                    }
                    return iReturnValue;
    • Marked as answer by PremjitM Monday, November 9, 2009 8:19 AM
    Monday, November 9, 2009 8:19 AM