Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Drilldown navigation menu by Replacing Divs (Clumsy)

Featured Replies

I made an attempt at a menu, that comprises of just replacing divs by showing and hiding. Kind of like a drilldown technique. I have the feeling that it is extremely long-winded, because i am a noob. Can anyone offer a cleaner or more beautiful technique. Am I missing the point?


Thanks


See fiddle


HTML



<div class="first">Choose a Department</div>
<div class="second">
<table class="Menu">
<tr>
<td>
<div class="third">Technology</div>
</td>
<td>
<div class="forth">Vehicles</div>
</td>
</tr>
</table>
</div>
<div class="seventh">
<table class="Menu">
<tr>
<td>
<div class="all"><a>Headphones</a>

</div>
</td>
<td>
<div class="all"><a>Watches</a>

</div>
</td>
<td>
<div class="nineth">Back</div>
</td>
</tr>
</table>
</div>
<div class="sixth">
<table class="Menu">
<tr>
<td><a>Engine-Powered</a>

</td>
<td><a>Human-Powered</a>

</td>
<td>
<div class="fifth">Back</div>
</td>
<td>
<div class="eighth">Top</div>
</td>
</tr>
</table>
</div>

JS



$(document).ready(function () { $('.first').show(); $('.second, .all, .seventh, .sixth').hide();
$('.first').click(function () {
$('.first, .second').hide();
$('.second').show();
return false;
});
});


$('.third').click(function () {
$('.second').hide();
$('.all, .seventh').show();
return false;
});


$('.forth').click(function () {
$('.second').hide();
$('.sixth,.eighth').show();
return false;
});


$('.fifth').click(function () {
$('.fifth, .sixth').hide();
$('.second').show();
return false;
});


$('.nineth').click(function () {
$('.seventh, .nineth').hide();
$('.second').show();
return false;
});

$('.eighth').click(function () {
$('.sixth, .fifth').hide();
$('.second').show();
return false;
});

CSS



table {
text-align:center;
width:80%;
cursor:pointer;
}
tr {
width:50%;
background:red;
}

Do you have an example of the effect you want to achieve? I had a quick look at your fiddle, but i didn't understand where you were going with it!

  • Author

Do you have an example of the effect you want to achieve? I had a quick look at your fiddle, but i didn't understand where you were going with it!

 

Hi Ash, the effect I am looking for should follow this logic.

4806d1438716629-drilldown-navigation-men

 

 

like this click through...

4807d1438716646-drilldown-navigation-men

Edited by 98sfsdf8

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.