News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to create Drop down Menu

Started by Awilum, August 10, 2009, 11:40:31 AM

Previous topic - Next topic

Awilum

How to create Drop down Menu for SMF 1.1.10
I try to use a mod Drop down Menu but it does not work in  SMF 1.1.10  only in 2.0
I need help
 
Web Development Art - Programming :: Design :: SEO
| My web projects |

babjusi

Quote from: Awilum on August 10, 2009, 11:40:31 AM
How to create Drop down Menu for SMF 1.1.10
I try to use a mod Drop down Menu but it does not work in  SMF 1.1.10  only in 2.0
I need help
 

http://www.simplemachines.org/community/index.php?topic=253756.0


Awilum

Web Development Art - Programming :: Design :: SEO
| My web projects |


Awilum

Now menu on the left
How to locate this menu on right part.

http://s19.radikal.ru/i192/0908/8b/a847bee4d641.jpg

code

// Show the start of the tab section.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="" height="32">

            <div id="menu">
               <ul class="menu">
                     
                  <li class="level1"><a href="', $scripturl, '" class="level1"><span><span class="title">' , ' test ' , '</span></span></a></li>

                  <li class="level1"><a href="', $scripturl, '?action=help" class="level1"><span><span class="title">' , ' test ' , '</span></span></a></li>';

                  // How about the [search] button?
                  if ($context['allow_search'])
                  echo '
                                  <li class="level1"><a href="', $scripturl, '?action=search" class="level1"><span><span class="title">' , ' test ' , '</span></span></a></li>';

                  // Is the user allowed to administrate at all? ([admin])
                  if ($context['allow_admin'])
                  echo '
                                  <li class="level1"><a href="', $scripturl, '?action=admin" class="level1"><span><span class="title">' , ' test ' , '</span></span></a></li>';
                             
                  // Edit Profile... [profile]
                  if ($context['allow_edit_profile'])
                  echo '
                                  <li class="level1 parent"><a href="', $scripturl, '?action=profile" class="level1 parent"><span><span class="title">' , ' test ' , '</span></span></a>
                                  <ul class="level2">
                      <li class="level2"><a href="', $scripturl, '?action=profile" class="level2"><span>' , $txt['hcm_summary'] , '</span></a></li>
                      <li class="level2"><a href="', $scripturl, '?action=profile;sa=account" class="level2"><span>' , $txt['hcm_account'] , '</span></a></li>
                      <li class="level2"><a href="', $scripturl, '?action=profile;sa=forumProfile" class="level2"><span>' , $txt['hcm_forumProfile'] , '</span></a></li>
                  </ul></li>';


                  // Go to PM center... [pm]
                  if ($context['user']['is_logged'] && $context['allow_pm'])
                  echo '
                                  <li class="level1 parent"><a href="', $scripturl, '?action=pm" class="level1 parent"><span><span class="title">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></span></a>
                                  <ul class="level2">
                      <li class="level2"><a href="', $scripturl, '?action=pm" class="level2"><span>' , $txt['hcm_readmessages'] , '</span></a></li>
                      <li class="level2"><a href="', $scripturl, '?action=pm;sa=send" class="level2"><span>' , $txt['hcm_sendmessage'] , '</span></a></li>
                  </ul></li>';


                  // The [calendar]!
                  if ($context['allow_calendar'])
                  echo '
                                  <li class="level1"><a href="', $scripturl, '?action=calendar" class="level1"><span><span class="title">' , $txt['calendar24'] , '</span></span></a></li>';


                  // the [member] list button
                  if ($context['allow_memberlist'])
                  echo '
                                  <li class="level1 parent"><a href="', $scripturl, '?action=mlist" class="level1 parent"><span><span class="title">' ,' test ' , '</span></span></a>
                                  <ul class="level2">
                      <li class="level2"><a href="', $scripturl, '?action=mlist" class="level2"><span>' , $txt['hcm_viewmembers'] , '</span></a></li>
                      <li class="level2"><a href="', $scripturl, '?action=mlist;sa=search" class="level2"><span>' , $txt['hcm_searchmembers'] , '</span></a></li>
                  </ul></li>';

                           
                  // If the user is a guest, show [login] button.
                  if ($context['user']['is_guest'])
                  echo '
                                  <li class="level1"><a href="', $scripturl, '?action=login" class="level1"><span><span class="title">' , ' test ' , '</span></span></a></li>';
                           
                  // If the user is a guest, also show [register] button.
                  if ($context['user']['is_guest'])
                  echo '
                                 <li class="level1"><a href="', $scripturl, '?action=register" class="level1"><span><span class="title">' ,' test ' , '</span></span></a></li>';
                           
                  // Otherwise, they might want to [logout]...
                  if ($context['user']['is_logged'])
                  echo '
                      <li class="level1"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '" class="level1"><span><span class="title">' ,' test ', '</span></span></a></li>';

            echo '
                            </ul>

                  </div>

</td>
</tr>
</table>';

   


Web Development Art - Programming :: Design :: SEO
| My web projects |

Faevilangel

could you attatch your style.css file  ;D
I am available for theme work, pm me for info

Awilum

css

/* Normal, standard links. */
a:link {
color: #808080;
text-decoration: none;
}

a:visited {
color: #757575;
text-decoration: none;
}

a:hover {
color: #16b7c5;
}

/* Navigation links - for the link tree. */
.nav, .nav:link, .nav:visited {
color: #8f8f8f;
text-decoration: none;
}

a.nav:hover {
color: #16b7c5;
text-decoration: none;
}

/* Tables should show empty cells. */
table {
empty-cells: show;
width: 1000;
}

/* By default (td, body..) use verdana in black. */
body, td, th , tr {
font-family: verdana, arial, helvetica, sans-serif;
line-height: 145%;
color: #505050;
font-size: 11px;
}

/* The main body of the entire forum. */
body {
margin: 0;
padding: 0;
background: #ffffff;
}

/* Input boxes - just a bit smaller than normal so they align well. */
input, textarea, button {
color: #808080;
font-family: verdana, sans-serif;
}

input, button {
font-size: 110%;
}

textarea {
font-size: 110%;
color: #000;
font-family: verdana, sans-serif;
}

/* All input elements that are checkboxes or radio buttons. */
input.check {
}

/* Selects are a bit smaller, because it makes them look even better 8). */
select {
font-size: 110%;
font-weight: normal;
color: #000;
font-family: verdana, sans-serif;
}

/* Standard horizontal rule.. ([hr], etc.) */
hr, .hrcolor {
height: 1px;
border: 0;
color: #666;
background-color: #a7a5a5;
}

/* No image should have a border when linked */
a img {
border: 0;
}

/* A quote, perhaps from another post. */
.quote {
color: #3a3a3a;
background-color: #efefef;
border: 1px solid #cfcfcf;
margin: 4px;
padding: 4px;
font-size: x-small;
line-height: 1.4em;
}

/* A code block - maybe even PHP ;). */
.code {
color: #3a3a3a;
background-color: #eff9fa;
/*font-family: "courier new", "times new roman", monospace;*/
font-size: x-small;
line-height: 1.3em;
/* Put a nice border around it. */
border: 1px solid #ddf7f9;
margin: 1px auto 1px auto;
padding: 1px;
width: 99%;
/* Don't wrap its contents, and show scrollbars. */
white-space: nowrap;
overflow: auto;
/* Stop after about 24 lines, and just show a scrollbar. */
max-height: 24em;
}

/* The "Quote:" and "Code:" header parts... */
.quoteheader, .codeheader {
color: #000;
text-decoration: none;
font-style: normal;
font-weight: bold;
font-size: x-small;
line-height: 1.2em;
}

/* Generally, those [?] icons.  This makes your cursor a help icon. */
.help {
cursor: help;
}

/* /me uses this a lot. (emote, try typing /me in a post.) */
.meaction {
color: red;
}

/* The main post box - this makes it as wide as possible. */
.editor {
width: 96%;
}

/* Highlighted text - such as search results. */
.highlight {
background-color: yellow;
font-weight: bold;
color: black;
}

/* Alternating backgrounds for posts, and several other sections of the forum. */
.windowbg {
padding: 5px;
background-color: #FDFDFD; 
border: 0px solid #8D8D8D;
}

.windowbg2 {
padding: 5px;
background-color: #FDFDFD;
border: 0px solid #8D8D8D;
}

.windowbg3 {
padding: 5px;
background-color: #fff;
border: 0px solid #8D8D8D;
}
/* the today container in calendar */
.calendar_today {
background-color: #fff;
}

/* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */
.titlebg, tr.titlebg th, tr.titlebg td, .titlebg2, tr.titlebg2 th, tr.titlebg2 td {
color: #16b7c5;
font-style: normal;
background: #4C4C4C; url(images/titlebg.png) repeat-x;
padding-left: 10px;
padding-right: 10px;
line-height: 23px;
border-bottom: 0px solid #fff;
}
.titlebg, .titlebg a:link, .titlebg a:visited {
font-weight: bold;
color: #16b7c5;
font-style: normal;
}

.titlebg a:hover {
text-decoration: underline;
}

/* same as titlebg, but used where bold text is not needed */
.titlebg2 a:link, .titlebg2 a:visited {
color: #fff;
font-style: normal;
text-decoration: none;
}

.titlebg, .titlebg2 {
color:#fff;
font-family: Tahoma, sans-serif;
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
}

.titlebg2 a:hover {
text-decoration: underline;
}

/* This is used for categories, page indexes, and several other areas in the forum.
.catbg and .catbg2 is for boardindex, while .catbg3 is for messageindex and display headers*/
.catbg , tr.catbg td , .catbg3 , tr.catbg3 td {
background: #f0f0f0 url(images/catbg.png) repeat-x;
color: #fff;
padding-left: 10px;
padding-right: 10px;
line-height: 25px;
}

.catbg2 , tr.catbg2 td {
background: #f0f0f0 url(images/catbg.png) repeat-x;
color: #fff;
padding-left: 10px;
padding-right: 10px;
line-height: 25px;
}

.catbg, .catbg2, .catbg3 {
font-size: 11px;
font-weight: bold;
font-family: Tahoma, sans-serif;
}

.catbg, .catbg2 {
font-weight: bold;
}

.catbg3, tr.catbg3 td, .catbg3 a:link, .catbg3 a:visited {
font-size: 95%;
color: #fff;
text-decoration: none;
}

.catbg a:link, .catbg a:visited , .catbg2 a:link, .catbg2 a:visited {
color: #fff;
text-decoration: none;
}

.catbg a:hover, .catbg2 a:hover, .catbg3 a:hover {
color: #bbbbbb;
}

/* This is used for tables that have a grid/border background color (such as the topic listing.) */
.bordercolor {
background: #e4e4e4;
padding: 1px;
margin: 2px;
}

/* This is used on tables that should just have a border around them. */
.tborder {
}

/* Default font sizes: small (8pt), normal (10pt), and large (14pt). */
.smalltext {
font-size: x-small;
font-family: verdana, sans-serif;
}

.middletext {
line-height: 18px;
text-indent: 10px;
}

.normaltext {
font-size: small;
}

.largetext {
font-size: large;
}

/* Posts and personal messages displayed throughout the forum. */
.post, .personalmessage {
width: 100%;
overflow: auto;
line-height: 1.3em;
}

/* All the signatures used in the forum.  If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
.signature {
width: 100%;
overflow: auto;
padding-bottom: 3px;
line-height: 1.3em;
}

/* Sometimes there will be an error when you post */
.error {
color: red;
}

/* definitions for the main tab, active means the tab reflects which page is displayed */
.maintab_first, .maintab_back, .maintab_last, .maintab_active_first, .maintab_active_back, .maintab_active_last {
color: white;
vertical-align: top;
}

.maintab_back, .maintab_active_back {
color: white;
text-decoration: none;
font-size: 10px;
vertical-align: top;
padding: 2px 6px 2px 6px;
font-family: tahoma, sans-serif;
font-weight: bold;
}

.maintab_first {
background: #a7a5a5 url(images/maintab-left.gif) 0 100% no-repeat;
width: 10px;
}

.maintab_back {
background: #a7a5a5;
}

.maintab_last {
background: #a7a5a5 url(images/maintab-right.gif) 100% 100% no-repeat;
width: 10px;
}

.maintab_active_first {
background: #16b7c5 url(images/mirrortab-active-left.gif) 0 0 no-repeat;
width: 8px;
}

.maintab_active_back {
background: #16b7c5;
}

.maintab_active_last {
background: #16b7c5 url(images/mirrortab-active-right.gif) 100% 0 no-repeat;
width: 8px;
}

/* how links behave in main tab. */
.maintab_back a:link , .maintab_back a:visited, .maintab_active_back a:link , .maintab_active_back a:visited {
color: white;
text-decoration: none;
}

.maintab_back a:hover, .maintab_active_back a:hover {
color: #ffffff;
text-decoration: none;
}

/* definitions for the mirror tab */
.mirrortab_first, .mirrortab_back, .mirrortab_last, .mirrortab_active_first, .mirrortab_active_back, .mirrortab_active_last {
color: white;
vertical-align: top;
}

.mirrortab_back, .mirrortab_active_back {
color: white;
text-decoration: none;
font-size: 10px;
vertical-align: top;
padding: 2px 6px 2px 6px;
font-family: tahoma, sans-serif;
font-weight: bold;
}

.mirrortab_first {
background: #16b7c5 url(images/mirrortab-left.gif) 0 0 no-repeat;
width: 10px;
}

.mirrortab_back {
background: #16b7c5;
}

.mirrortab_last {
background: #16b7c5 url(images/mirrortab-right.gif) 100% 0 no-repeat;
width: 10px;
}

.mirrortab_active_first {
background: #a7a5a5 url(images/maintab-active-left.gif) 0 0 no-repeat;
width: 8px;
}

.mirrortab_active_back {
background: #a7a5a5;
}

.mirrortab_active_last {
background: #a7a5a5 url(images/maintab-active-right.gif) 100% 0 no-repeat;
width: 8px;
}

/* how links behave in mirror tab. */
.mirrortab_back a:link , .mirrortab_back a:visited, .mirrortab_active_back a:link , .mirrortab_active_back a:visited {
color: white;
text-decoration: none;
}

.mirrortab_back a:hover, .mirrortab_active_back a:hover {
color: #343434;
text-decoration: none;
}

/* The AJAX notifier */
#ajax_in_progress {
background: #32CD32;
color: white;
text-align: center;
font-weight: bold;
font-size: 18pt;
padding: 3px;
width: 100%;
position: fixed;
top: 0;
left: 0;

}

#body-top {
background: #ffffff url(images/bg.gif) repeat-x;
padding: 0;
margin: 0;
}

#mainarea {
background: #f0f0f0;
padding: 5px 10px 10px 10px;
margin: 0;


}

#header {
position: relative;
height: 171px;
overflow: hidden;
background: #343434 url(images/header-bg.gif) repeat-x;
}

#headerleft {
height: 171px;
background: url(images/header-left.gif) 0 0 no-repeat;
position: relative;

}

#headerright {
height: 171px;
background: url(images/header-right.gif) 100% 0 no-repeat;
position: relative;
}

#container {
width: 1280px;
margin: 0px auto 20px auto;
}

#logo, #logo a {
position: absolute;
top: 51px;
left: 0;
display: block;
width: 400px;
height: 90px;
background: url(images/logo.gif) no-repeat;
}

#welcome {
font-size: 1.0em;
color: #999;
font-family: tahoma, sans-serif;
float: right;
padding: 20px 30px 0 0;
text-align: right;
}

#welcome a:link, #welcome a:visited {
color: #808080;
font-weight: bold;
}

#welcome a:hover {
text-decoration: underline;
}

#footer {
background: #343434 url(images/footer-bg.gif) 0 0 repeat-x;
text-align: center;
margin: 0;
padding: 0;
font-size: 10px;
color: #909090;
}

#footer-left {
background: url(images/footer-left.gif) 0 0 no-repeat;
}

#footer-right {
background: url(images/footer-right.gif) 100% 0 no-repeat;
height: 80px;
overflow: hidden;
}

#footer a:link , #footer a:visited{
color: #707070;
}

#footer a:hover{
color: #aaa;
}

#menubar {
margin: 0;
padding: 0;
height: 45px;

}

/* Box BBCode */
.box_bbcode { margin: 10px 50px 10px 50px; border: 1px solid #ADADAD; }
.box_bbcode legend {color: #476C8E }


/* DropDownMenu */

div#menu {
left: 40px;
z-index: 11;
height: 39px;
        background: #757575;

}

div#menu ul {
margin: 0px;
padding: 0px;
list-style: none;
float: left; 
}

div#menu li {
position: relative;
margin: 0px;
padding: 0px;
display: block;
float: left;
z-index: 5; 
font-weight: bold;
}

div#menu li a, #menu li span.separator {
height: 39px;
display: block;
float: left;
line-height: 32px;
text-decoration: none;
color: #FFFFFF;
}

div#menu li span { 
display: block;
}

div#menu li span { 
background-repeat: no-repeat;
background-position: 95% 0px;
}

div#menu a:hover, div#menu span.separator:hover, div#menu span.sfhover { 
color: #D2D2D2;
}

div#menu li.active { 
font-weight: bold;
}

div#menu li.active ul { 
font-weight: normal;
}

div#menu li.parent span.separator { 
cursor: pointer;
}


div#menu ul.menu {
padding-right: 1px;
background: #757575;
}

div#menu li.level1 {
background: #757575;
}

div#menu a.level1, div#menu span.level1 {
background: #757575;
color: #FFFFFF; /*Change your menu link color in here*/
font-size: 110%; /*Change your menu font size in here*/

}

div#menu a.level1 span, div#menu span.level1 span {
padding: 5px 20px 0px 20px;
}

div#menu li:hover a.level1, div#menu li.sfhover a.level1, div#menu li:hover span.level1, div#menu li.sfhover span.level1 { 
color: #CFD7DE;
}

div#menu li.active a.level1, div#menu li.active span.level1 { 
color: #aa1428;  /*Change your menu link hover color in here*/
font-weight: bold;
}


div#menu a.level1 span.title, div#menu span.level1 span.title{
padding: 0px;
}


div#menu a.level1 span.sub, div#menu span.level1 span.sub {
padding: 0px;
font-size: 60%;
font-weight: normal;
color: #969696;
margin-top: -6px;
line-height: 10px;
}


div#menu li:hover a.level1 span.sub, div#menu li:hover span.level1 span.sub, div#menu li.sfhover a.level1 span.sub, div#menu li.sfhover span.level1 span.sub {
color: #ffffff;
}


div#menu ul.menu ul {
position: absolute;
top: 40px;
left: -999em; 
width: 165px;
        font-size: 88%;
}

div#menu li:hover ul, div#menu li.sfhover ul {
left: 0px; 
z-index: 100;
}

div#menu li.level1 li {
    width: 100%; 
text-indent: 15px;
}


div#menu li.level1 li a, div#menu li.level1 li span.separator{
height: 25px;
padding: 0px;
margin: 0px 1px;;
background: #757575; /*Change your submenu background color in here*/
float: none; 
display: block;
line-height: 25px
}
Web Development Art - Programming :: Design :: SEO
| My web projects |

Faevilangel

Find:

div#menu {
left: 40px;
z-index: 11;
height: 39px;
background: #757575;
}


Replace with:

div#menu {
float:right;
z-index: 11;
height: 39px;
background: #757575;
}


That may or not work,
I am available for theme work, pm me for info

Awilum

I think it work. But one problem.
When mouse is on menu level1 , level 2 have open. But when mouse goes slowly to menu level2 it disappeared  :(
When I do it quickly menu level2 shows and works.

How to fix it ?
Web Development Art - Programming :: Design :: SEO
| My web projects |

Faevilangel

do you have a link so i can see what you mean
I am available for theme work, pm me for info

Awilum

Web Development Art - Programming :: Design :: SEO
| My web projects |

Faevilangel

could have been a cache problem

glad its solved
I am available for theme work, pm me for info

Advertisement: