Menu Similar to Wordpress Admin Interface

Is there a tutorial or jQuery plugin available that can create a menu that collapses both vertically and horizontally? I've searched online but only found options for vertical collapsing menus. The Wordpress option seems to be too integrated for my needs.

EDIT: I have added some screenshots for reference. The first image shows the normal state, the second shows the menu expanded/collapsed vertically, and the third shows it collapsed horizontally.

Answer №2

To create a collapsible menu for your website, you have a few options. One option is to use a plugin like Accordion or Collapsible Menu for the vertical collapse, and then implement a horizontal collapse feature with a plugin like TabSlideOut. Alternatively, you can simply adjust the width of the menu DIV using .animate().

It's worth noting that WordPress has a feature where it removes text from menus while retaining the icons.

Answer №3

html

<div class="hide-menu">Hide Menu</div>
<ul id="menu">
    <li><a href="#">Link 1</a></li>
    <li><a href="#">Link 2</a></li>
    <li>
         <ul class="subs"><li><a href="">Subs</a></li></ul>
    </li>
</ul>

jQuery

$('.hide-menu').bind('click',function (){
    $('#menu').animate({width:30});//can always extend this.
    //u can use the if statement or toggle if u need toggling feature
});
$('#menu').children('li').bind('click',function (){
     //here u can hide the subs
})

Of course, the above code may not work exactly like Wordpress, but it provides a basic idea of what to do. :) Hope this helps!

Answer №4

To create a horizontal toggle effect, you can use jQuery to add or remove a class when a button is clicked. Here's an example of how you can achieve this:

$(my-button).click(function(e){
     $(my-menu-selector).toggleClass(your-class);
     e.preventDefault();

});

You can then use CSS to show or hide the text of each list item in your menu by applying a text-indent property. Here's how you can do it:

.hide-horizontal {
    text-indent: -999em;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Customize the Carousel navigation arrows in Bootstrap 3

Greetings everyone, I am currently utilizing Bootstrap's Carousel options and I am looking to change the appearance of the arrows as I find them unattractive. My desired look for the arrows is as follows: https://i.sstatic.net/Rz9Mb.png However, I ...

Generating a collection of nested objects from an array of non-nested objects

If I were to present an array like the one below: [ { 'id':48, 'parent':0, 'order':1 }, { 'id':49, 'parent':48, 'order':2 }, { &ap ...

Centering Headings and <span> in Bootstrap 3: A Complete Guide

How do I center a heading or styled text within a Bootstrap3 column while customizing the text? If I use "text-center" and "p" tags, everything aligns perfectly, but if I want to style the text further, it becomes a challenge. For example (works fine): ...

What methods are available to create a transition animation for an HTML 5 banner on iOS devices?

I need assistance with animating an HTML5 banner to transition vertically onto the screen in my app demo. After a prompt that triggers a server callback, the banner should smoothly move down from the top of the screen. The animation I am aiming for is simi ...

When Google Chrome encounters two variables or functions with the same name, how does it respond?

I am curious what happens when Google Chrome encounters two variables with the same name. In my particular case, this issue arises in the code snippet available at this link, which is a small portion of the entire code. I am facing an issue where placing C ...

Access account using lightbox effect for the login form

In my simple CSS code, I have used a litebox view. I removed unnecessary CSS properties to keep it clean: <style> .black_overlay{ display: block; } .white_content { display: block; } < ...

Creating a Drop-Down Button Using HTML, CSS, and JavaScript

I am currently working with the following code: <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=PT+Sans ...

"The JavaScript code that functions perfectly in the browser console, but fails to execute when running in the actual

I'm encountering an issue with a simple piece of JavaScript code that seems to only work when executed in the browser console: <script> $(".hopscotch-close").click(function () { alert("Hi"); Cookies.set("tourState", "closed" ...

The combination of jQuery UI 1.8.22 and jQuery 1.8 does not display any text on dialog buttons

Upon investigating whether the newest jQuery 1.8 (stable) was compatible with my current development project, I was surprised to encounter an unexpected issue: This caught me off guard as I had already upgraded to jQuery UI 1.8.22, which, based on its rel ...

Tips for effectively retrieving and interpreting the information received from an AJAX request on a RESTful server

I am facing an issue while trying to access the data sent from the client to the server using an ajax function. Below is the code snippet of my ajax function: $(document).ready(function(){ $('#btnReg').click(function(){ ...

Unable to successfully link filter outcomes with input in AngularJS

Here is the code snippet I am working with: <body ng-app=""> <div ng-init="friends = [{name:'John', phone:'555-1276'}, {name:'Mary', phone:'800-BIG-MARY'}, {nam ...

Checking for conditions during the loop iteration

I am currently working on an HTML table using AngularJS. Below is the HTML code I have written. Here is the HTML code snippet: <table> <tr ng-repeat="data in myResults"> <td style="text-align: center;">{{data.name}}</td> ...

Image breaks out of container on mobile devices using Bootstrap 4

When I view my website on different phones, the image in my div jumps down and out of its container. It seems to be okay on some devices, but not on the Samsung Galaxy Note 9 for example. Despite trying various solutions to prevent this issue, such as usin ...

Is it not possible to change node labels in D3.js after clicking on a node?

After being inspired by this link, I successfully created a basic network visualization app using D3.js. The app reads node names from a textarea on an HTML page and then constructs a network where all nodes are interconnected. All the relevant code can ...

Unable to remove div element

Currently, I am working on writing a code for a webpage with specific functionalities. I need to display a button and an embedded YouTube video. When the user clicks on the video, they should be redirected to a different link (not YouTube) and the video sh ...

Table sorting parser that does not recognize div elements

I'm experiencing an issue with the tablesorter extension on my webpage. All my tables are working correctly except for one that contains a numeric value along with a div element. The problem arises because the tablesorter treats the content as text, c ...

Invoke a function from a different source in JavaScript

Below is the JS function implemented: function addMemberToLessonDirect(id) { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } ...

When attempting to process a JSON string with JQuery's parseJSON() method, no response or error is returned

I've spent some time searching on various forums to find a solution to my problem, but it seems that no one else has encountered it. I am retrieving a JSON string from a field in my MySQL table, which is in the following format: {"width":"10", "heig ...

Gaining administrative privileges (sudo) to utilize NPM module within Node application

I am currently working on a Node script that interacts with the NPM API. The script is functional, but some modules require admin access for installation. I attempted to run the script using `sudo`, however, it fails when requiring NPM. After simplifying ...

Arranging my HTML text fields for optimal organization

I am struggling to format my text fields the way I envision. Here's what I want: - Username field at the top - First and last name underneath each other - Password and confirm password next to each other below names As a newcomer to HTML, I'm fi ...