Problem with Dropdown-Menus and CSS-Layout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peterska2
    Senior Member
    • Oct 2003
    • 8869
    • 3.7.x

    #16
    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.

    Comment

    • Michelle
      Senior Member
      • Jul 2005
      • 408
      • 3.7.x

      #17
      Originally posted by Kerry-Anne
      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

      Comment

      • Luket79
        Member
        • Jun 2005
        • 50

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

        Comment

        • StGaensler
          Senior Member
          • Jan 2005
          • 119

          #19
          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

          Comment

          • Luket79
            Member
            • Jun 2005
            • 50

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

            Thanks!

            Comment

            • Suvega
              New Member
              • Oct 2008
              • 1
              • 3.7.x

              #21
              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';
              };

              Comment

              • Luket79
                Member
                • Jun 2005
                • 50

                #22
                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.

                Comment

                • zlos
                  Senior Member
                  • Jul 2004
                  • 183
                  • 3.8.x

                  #23
                  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.

                  Comment

                  • Hedelund
                    New Member
                    • May 2006
                    • 3
                    • 3.5.x

                    #24
                    ...got the same problem here.

                    Comment

                    • AndyN
                      New Member
                      • Jun 2008
                      • 9
                      • 3.7.x

                      #25
                      Doesn't work for me neither - i have div-driven style sheets ....

                      AndyN

                      Comment

                      • Giorno
                        Member
                        • Dec 2005
                        • 33
                        • 3.8.x

                        #26
                        same problem in 3.8.x
                        I opened a thread in the 3.8.x forum => here

                        Comment

                        • Xyabber
                          Senior Member
                          • Dec 2004
                          • 219

                          #27
                          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
                          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.

                          Comment

                          • Xyabber
                            Senior Member
                            • Dec 2004
                            • 219

                            #28
                            The only issue with code above is that the page-nav dropdown errors out... all others work.

                            Comment

                            • Giorno
                              Member
                              • Dec 2005
                              • 33
                              • 3.8.x

                              #29
                              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.

                              Comment

                              • WireNine.com
                                Member
                                • Jun 2005
                                • 56
                                • 3.8.x

                                #30
                                Thanks for posting that it helped me solve a few issues with our forums
                                ■█► WireNine.com Web Hosting 8+ years in business!
                                ■█► Shared Hosting, Reseller Hosting and VPS Hosting 24/7 Support 99.9% Uptime 60 Day Money Back Guarantee
                                ■█► cPanel, Litespeed, CloudFlare, Softaculous, Attracta SEO, Site Builder
                                ■█► Find us on Facebook and follow us @wirenine

                                Comment

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