Announcement

Collapse
No announcement yet.

Problem with Dropdown-Menus and CSS-Layout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cellarius
    replied
    Oh wow, that must be the very first thread I opened here on vb.com... (Sorry for the OT)

    Leave a comment:


  • WireNine.com
    replied
    Thanks for posting that it helped me solve a few issues with our forums

    Leave a comment:


  • Giorno
    replied
    FIXED!!! I found the solution on jfusion forum, credit to the original poster

    In the CSS I replaced "position:relative" with "position:inherit" for the DIVs that wrap the forum and now it works great!

    The only problem is that adding code to Extra CSS Attributes (like that post say) didn't work for me so I had to edit the vbulletin CSS. Maybe I don't know how Extra CSS Attributes box works.

    Leave a comment:


  • Xyabber
    replied
    The only issue with code above is that the page-nav dropdown errors out... all others work.

    Leave a comment:


  • Xyabber
    replied
    Hey StGaensler! I WOULD BUY YOU A BEER RIGHT NOW IF I COULD! THIS CODE WORKS GREAT. THANK YOU VERY MUCH!!!!

    Originally posted by StGaensler View Post
    Yes I have another solution

    Edit clientscript/vbulletin_menu.js and replace function vB_Popup_Menu.prototype.fetch_offset (line 472 in vB 3.6.4) with following function:
    Code:
    vB_Popup_Menu.prototype.fetch_offset = function(obj)
    {
        var left_offset = obj.offsetLeft;
        var top_offset = obj.offsetTop;
        var obj_orig = obj;
        var obj_menu = document.getElementById(obj.id + '_menu');
        var i = 0;
    
        while ((obj = obj.offsetParent) != null) i++;
        while ((obj_menu = obj_menu.offsetParent) != null) i--;
    
        obj = obj_orig;
    
        while(i > 0)
        {
            obj = obj.offsetParent;
            left_offset += obj.offsetLeft;
            top_offset += obj.offsetTop;
            i--;
        }
    
        return { 'left' : left_offset, 'top' : top_offset };
    };
    Would be fine if somebody could respond if it works with his style.

    Leave a comment:


  • Giorno
    replied
    same problem in 3.8.x
    I opened a thread in the 3.8.x forum => here

    Leave a comment:


  • AndyN
    replied
    Doesn't work for me neither - i have div-driven style sheets ....

    AndyN

    Leave a comment:


  • Hedelund
    replied
    ...got the same problem here.

    Leave a comment:


  • zlos
    replied
    I am afraid it does not help when it is called for div's with position declared differently as vB allows us to use
    I have the very same problem and I cannot agree to such behaviour of vB. Most of sites using external adservers must comply with RELATIVE positioning as well as z-index to avoid abnormal flash viewing.

    Thus, changing positioning of the main layer to relative makes vB menu to show off the expected position.

    It clearly does not look like a proper customer treatment here. Disappointing, I must say.

    Leave a comment:


  • Luket79
    replied
    The "search this forum" dropdown does not work on subforums. Would that have anything to do with this .js file? It works with the stock one but it floats like the others.

    Leave a comment:


  • Suvega
    replied
    I fixed the last bug of this code! Yay!! Look in the Vbulletin_menu.js, and replace the function: vB_Popup_Menu.prototype.set_menu_position = function(obj)
    With:
    Code:
    vB_Popup_Menu.prototype.set_menu_position = function(obj)
    {
     this.pos = this.fetch_offset(obj);
     this.leftpx = this.pos['left'];
     this.toppx = this.pos['top'] + obj.offsetHeight;
     
     var left_offset = obj.offsetLeft;
     var obj_orig = obj;
     var i = 0;
     while ((obj = obj.offsetParent) != null) i++;
     obj = obj_orig;
     while(i > 0)
     {
      obj = obj.offsetParent;
      left_offset += obj.offsetLeft;
      i--;
     }
          obj = obj_orig;
     
     if ((left_offset + this.menuobj.offsetWidth) >= document.body.clientWidth && (this.leftpx + obj.offsetWidth - this.menuobj.offsetWidth) > 0)
     {
      this.leftpx = this.leftpx + obj.offsetWidth - this.menuobj.offsetWidth;
      this.direction = 'right';
     }
     else
     {
      this.direction = 'left';
     }
     // move the pagenav menu to the calling object, so it appears to be styled like where it's displayed
     if (this.controlkey.match(/^pagenav\.\d+$/))
     {
      obj.appendChild(this.menuobj);
     }
     this.menuobj.style.left = this.leftpx + 'px';
     this.menuobj.style.top  = this.toppx + 'px';
    };

    Leave a comment:


  • Luket79
    replied
    Perfect! Works like a charm. Need to make sure I keep a copy of this file for future upgrades.

    Thanks!

    Leave a comment:


  • StGaensler
    replied
    Hi, either you search this file for the right place, or you download the uncompressed version in your members area, then editing should be easier

    Leave a comment:


  • Luket79
    replied
    Can you provide a copy of this updated file? I cannot seem to edit the file correctly, it's not separated in line numbers.

    Leave a comment:


  • Michelle
    replied
    Originally posted by Kerry-Anne View Post
    If it has not been reported in the bug tracker then it will be unlikely to be picked up on by the developers. In addition, we do not support modifications and this is an issue only with modified templates. Therefore, you should post at vBulletin.org for help with this.
    It has been posted in the bug tracker a long time ago (link).

    @cscgal: If you are sure that a line works properly, but it causes a js error, the way to go is the try...catch construct

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X