vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How To Add Drop Down Menus To Your Navbar (https://vborg.vbsupport.ru/showthread.php?t=122523)

Digital Jedi 01-21-2013 05:34 AM

Quote:

Originally Posted by microbob (Post 2398323)
1) So, as I understand it, I am going to leave the main headings [Green-colored code] where they currently are located (i.e., as in my previous post) in the Navbar template.

If that's where you want them, in a separate navbar, then they can technically go wherever you want. So long as everything is nested properly, they'll show up wherever you want them. Even outside the default navabar. It seems to be in it's own main div container, so you should be good as long as you've nested it properly in the overall HTML.

Quote:

2) Now, do I continue with additional heading entries using the menu code below, but where I change the heading from New York to New Jersey and rename "custommenu" to "custommenu1" [BLUE-colored code]?
Quote:

3) Where do I place this code so it shows up in the TOP-MENU in the Navbar template?
For these, the actual content of dropdown menus, these will all go in the same location as the fist one you made. That's mainly so you can find them again, and so they don't interfere with anything else. Their location is not the important part, however. Their unique identifiers are. The ID is what tells the the item clicked on which menu to display. So for example, you could just call the New York navbar link newyork:

Code:

<td id="newyork" class="vbmenu_control"><a href="#">New York</a><script type="text/javascript">vbmenu_register("newyork");</script>
</td>

See the two instances of newyork? That was where the two instances of custommenu were. This particular link is now going to execute JavaScript that's going to look for a div with the prefix newyork in its ID when someone clicks on it. So the actual menu content's id would be the one below:

Code:

<div class="vbmenu_popup" id="newyork_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">New York</td></tr>

<tr><td class="vbmenu_option"><a href="http://www.caught-the-skunk.com/index.php?pageid=new-york-supporters">NY Caught-The-Skunk.com Supporters</a></td></tr>

</table>
<div>

So, you give each of your cities/menu something unique to identify them by. So long as don't use any special characters or spaces, you can call them whatever you want.

Quote:

5) Is there (1) </table> followed by (1) </div> after I'm entered all this information?
Each menu item is a div with a table inside of them, so yes. Anything opened (<tag>) will have to be properly closed (</tag>). Similar to before:

Code:

<div>
    <table>
      <tr><td>menu item</td></tr>
      <tr><td>menu item</td></tr>
    </table>
</div>

Quote:

6) Finally, I want to make each of the headings look like a button in menu bars. Is this something you can help me with? vBulletin default is ok. Don't want his image; just want the button effect. Here is the example:

https://vborg.vbsupport.ru/showthread.php?t=245441
Actually, you can still follow his tutorial, just pick the image you want to use. Open up the Style Manager as he directs and look for the Edit CSS option. Then look for the block that handles the vbmenu_control class. Because it's CSS, you can do, well, all kinds of things to the menu. But just try out as he's directed, and you should get a really good idea of what you want to do from there. Also check W3Schools for their CSS tutorials and reference guide. Their very explanatory, but very brief. Easy to quickly grasp CSS from their tutorials in my opinion.

Quote:

I want to thank you for this help. It is greatly appreciated!!! I'm just an average Joe struggling with these little changes but learning along the way.

Bob
Your welcome. I just pretend I know what I'm talking about. Wait until you interact with someone who REALLY knows what he's talking about here. :eek:

microbob 01-21-2013 10:56 PM

After pulling my hair out for a few hours, I finally (through trial and error) figured it out. I actually wound up deleting the GREEN CODE and worked with your suggestions. Thank God! And thanks to the Digital Jedi too! Lots of work to put in all of those drop-downs in (6) headings but I really like it. Now I don't have to work on putting the "Superfish" menu up.

Now...as far as the BUTTON EFFECT is concerned, I have found the "CSS Selector: vbmenu_control" under "Popup Menu Controls" in the Admin CP.

Very important: I do NOT want to use his image; just want to use the standard "blue" Background (#738FBF) on the entire top & bottom menus, as the button's color. Just looking for the button effect.

My current default "Extra CSS Attributes" in the "Popup Menu Controls" is currently set as:

padding 3px 6px 3px 6px
white-space: nowrap;


How do I get the button effect?

Bob

Digital Jedi 01-22-2013 12:49 AM

Quote:

Originally Posted by microbob (Post 2398509)
After pulling my hair out for a few hours, I finally (through trial and error) figured it out. I actually wound up deleting the GREEN CODE and worked with your suggestions. Thank God! And thanks to the Digital Jedi too! Lots of work to put in all of those drop-downs in (6) headings but I really like it. Now I don't have to work on putting the "Superfish" menu up.

Now...as far as the BUTTON EFFECT is concerned, I have found the "CSS Selector: vbmenu_control" under "Popup Menu Controls" in the Admin CP.

Very important: I do NOT want to use his image; just want to use the standard "blue" Background (#738FBF) on the entire top & bottom menus, as the button's color. Just looking for the button effect.

My current default "Extra CSS Attributes" in the "Popup Menu Controls" is currently set as:

padding 3px 6px 3px 6px
white-space: nowrap;


How do I get the button effect?

Bob

I think you might mean something else by "button effect" than what he's demonstrating in his tutorial. In his case, the image IS the button effect. He creates the illusion of buttons by adding a background image to that class and adjusting its padding so there appears to be spaces in between. You can still have that kind of button without a background image, it would just be solid in color.

microbob 01-22-2013 12:57 AM

I see.

So how would I do the solid color to make it look like a button?

And/or maybe a white (or other color) vertical dividing line to separate the headings?

Bob

Digital Jedi 01-22-2013 01:16 AM

I personally would do that by setting the left or right margins to about a pixel or so. Something like margin-left:2px;. That would put a space beside every menu item, which will be the background color of the navbar. Try something like this in the additional CSS field:

Code:

margin-left:2px; /* This puts the space beside each item with this class. */
padding:0 6px 0 6px; /* This sets the spacing inside the items with this class clockwise from the top. */
white-space:nowrap; /* This makes certain the text of the items stays on one line */


dat.phan 12-13-2013 06:43 AM

How I can do if I want add to vb5

Digital Jedi 12-13-2013 04:56 PM

Certainly not using this vB3 article. As far as know, vB5 doesn't have native dropdowns. You would have to get a custom one and integrate it yourself.

dat.phan 12-14-2013 04:24 AM

thank you :D

macgyvers 01-19-2014 10:54 AM

My drop-down menu is missing ... where to look the code :( ... http://bit.ly/1dNYQwP


All times are GMT. The time now is 06:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03433 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete