Customizing SMF > Theme Site Themes

Touch

<< < (3/9) > >>

lmbuehrer:
Using this! I love it! I like how when you click my profile it drops down!!

Soulmaster:
really a great theme but... howto make pulldown menus ?

kenet:
Search:


--- Code: ---// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '
      <div id="main_menu">
         <ul class="menu_touch">';
         foreach ($context['menu_buttons'] as $act => $button)
         echo '
            <li id="button_', $act, '"><a class="', $button['active_button'] ? 'current ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '><b>', $button['title'], '</b></a></li>';

      echo '
         </ul>
      </div>';
}
--- End code ---

Replaced by:


--- Code: ---// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '
      <div id="main_menu">
         <ul class="menu_touch">';
         
   foreach ($context['menu_buttons'] as $act => $button)
   {
      echo '
            <li id="button_', $act, '">
               <a class="', $button['active_button'] ? 'active ' : '', 'current" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
                  <b>', $button['title'], '</b>
               </a>';
      if (!empty($button['sub_buttons']))
      {
         echo '
               <ul>';

         foreach ($button['sub_buttons'] as $childbutton)
         {
            echo '
                  <li>
                     <a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
                        <span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
                     </a>';
            // 3rd level menus
            if (!empty($childbutton['sub_buttons']))
            {
               echo '
                     <ul>';

               foreach ($childbutton['sub_buttons'] as $grandchildbutton)
                  echo '
                        <li>
                           <a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
                              <span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
                           </a>
                        </li>';

               echo '
                     </ul>';
            }

            echo '
                  </li>';
         }
            echo '
               </ul>';
      }
      echo '
            </li>';
   }

   echo '
         </ul>
      </div>';
}
--- End code ---

Open your index.css
Search:


--- Code: ---.menu_touch li a:hover b {
   background:url(../images/theme/menu_e.gif) no-repeat right top;
}
--- End code ---


Then add:


--- Code: ---/* The dropdown menu - Touch */

.menu_touch li ul {
   background: #f2f2f2;
   padding: 0;
   border-left: 1px solid #293D4F;
   border-right: 1px solid #293D4F;
   border-bottom: 1px solid #293D4F;
   display: none;
   height: auto;
   filter: alpha(opacity=95);
  opacity: 0.95;
  top: 45px;
  position: absolute;
  width: 225px;
  z-index: 200;
}
.menu_touch li:hover ul {
   display: block;
}
.menu_touch li li {
   display: block;
   float: none;
   width: 225px;
}
.menu_touch li ul a {
   background: none;
   padding: 0 5px;
   float: none;
   text-align: left;
}
.menu_touch li ul a:hover {
   background: #cdcdcd;
   color: #006699;
   opacity: 1.0;
   filter: alpha(opacity=100);
}
/* ------- End Menu - Touch ------- */
--- End code ---

credit: YIHAD

Soulmaster:
tnx :)

Soulmaster:
great :) it works :) www.bliksemdetectie.nl   

but now a other question to make this great theme even better. 

is it possible to make in the right uppercorner before of behind search a facebook and twitter icon? and than put the urls for it in the theme account.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version