Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:19:58+00:00 2026-05-25T14:19:58+00:00

My DNN module has some imagebuttons that show a sub-menu when clicked. The absolute

  • 0

My DNN module has some imagebuttons that show a sub-menu when clicked. The absolute position of the menu is calculated using javascript, as expected. This has worked well till now (In DNN4 and DNN5). But we are noticing a problem in DNN6. The menu position is off by a significant number of pixels (probably a couple hundred).
Since I did not write the calculation code, and neither am I a JS expert, I cannot understand how DNN6 is affecting it.
Here is the function:

function AbsolutePosition(obj) {
        var pos = null;
        if(obj != null) {
            pos = new Object();
            pos.top = obj.offsetTop;
            pos.left = obj.offsetLeft;
            pos.width = obj.offsetWidth;
            pos.height= obj.offsetHeight;
            obj = obj.offsetParent;
            while(obj != null) {
                pos.top += obj.offsetTop;
                pos.left += obj.offsetLeft;
                obj = obj.offsetParent;
            }
        }
return(pos);
}

I would like to understand how this code can be affected by the parent page structure – because changing the skin did not make any difference. This has something to do with how page elements are organized.

Edit: And I am also looking for suggestions regarding any modifications to the code that I could try.

Any input appreciated! Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:19:58+00:00Added an answer on May 25, 2026 at 2:19 pm

    This has to do with how absolute positioning works. When an element is absolutely positioned, its position (indicated by the top and left elements in the code above) is relative to its closest ancestor with a position style of either relative or absolute. In DNN 6, module wrappers now have position: relative specified on them (which the new action menu uses for positioning). There might also be some similar changes for the new control panel (if the menu isn’t in a module).

    You might try this script, which stops climbing the tree if the element’s position is absolute or relative:

    function AbsolutePosition(obj) {
        if (!obj) {
            return null;
        }
    
        var pos = {
            top: obj.offsetTop,
            left: obj.offsetLeft,
            width: obj.offsetWidth,
            height: obj.offsetHeight
        },
        positionsToStopAt = {
            relative: true,
            absolute: true
        };
    
        obj = obj.offsetParent;
        while(obj && !positionsToStopAt[jQuery(obj).css('position')]) {
            pos.top += obj.offsetTop;
            pos.left += obj.offsetLeft;
            obj = obj.offsetParent;
        }
    
        return pos;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My DNN module encrypts some data using my public key and presents it to
I am trying to develop a module and using the how-to guide that dnn
I am using dnn 6. It has file dotnetnuke/js/dnn.jquery.js so I created a module
I'd like to create a module in DNN that, similar to the Announcements control,
Is there anyway to use the built-in DNN Menu module to display a menu
I am developing a slide show module for DNN, I have completed the module
I am developing DNN modules and I am using jQuery in some modules, I
I'm writing a simple DNN module - using DNN 5.6.1 and currently just working
I recently updated to DNN 5.6 and noticed that in my HTML module the
I have found two modules that save their module specific settings without using sql

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.