How to style individual menu items differently in jQuery UI Menu

0 votes
With the help of code can i know How to style individual menu items differently in jQuery UI Menu?
11 hours ago in Node-js by Nidhi
• 14,200 points
12 views

1 answer to this question.

0 votes

To style individual menu items differently in a jQuery UI Menu, you can use custom CSS classes:

Using Custom CSS Classes

$(function() {

  $("#menu").menu({

    create: function(event, ui) {

      $(this).find("li").eq(0).addClass("highlight-item"); // First item

      $(this).find("li").eq(2).addClass("warning-item");  // Third item

    }

  });

});

CSS:

.highlight-item a {

  background-color: #ffeb3b !important;

  color: #333 !important;

  font-weight: bold;

}


.warning-item a {

  background-color: #ff5722 !important;

  color: white !important;

}

answered 5 hours ago by anonymous

Related Questions In Node-js

0 votes
0 answers

How to create a multi-level dropdown menu using jQuery UI Menu?

Can i know How to create a ...READ MORE

11 hours ago in Node-js by Ashutosh
• 25,410 points
8 views
0 votes
1 answer
0 votes
0 answers

How to create a multi-level dropdown menu in Bootstrap 3?

Can you tell me How to create ...READ MORE

6 days ago in Node-js by Ashutosh
• 25,410 points
48 views
0 votes
0 answers

How to customize icons for expand/collapse in jQuery Accordion headers?

Can you tell me How to customize ...READ MORE

11 hours ago in Node-js by Ashutosh
• 25,410 points
8 views
0 votes
0 answers

How to create a single-page navigation system using jQuery Mobile?

Can you tell me How to create ...READ MORE

11 hours ago in Node-js by Nidhi
• 14,200 points
10 views
0 votes
0 answers

How to implement a time picker alongside jQuery UI Datepicker?

Can you explian to me How to ...READ MORE

11 hours ago in Node-js by Nidhi
• 14,200 points
12 views
0 votes
1 answer

How to implement swipe gestures for navigation in jQuery Mobile?

To enable swipe gestures for page navigation ...READ MORE

answered 5 hours ago in Node-js by anonymous
15 views
0 votes
1 answer

How to handle form submissions asynchronously in jQuery Mobile applications?

To effectively manage asynchronous form submissions in ...READ MORE

answered 5 hours ago in Java-Script by anonymous
21 views
0 votes
1 answer

How to disable weekends in jQuery UI Datepicker selection?

To disable weekends (Saturdays and Sundays) in ...READ MORE

answered 5 hours ago in Node-js by anonymous
13 views
0 votes
1 answer

How to highlight specific dates with custom styles in jQuery UI Datepicker?

Here's how to highlight specific dates with ...READ MORE

answered 5 hours ago in Node-js by anonymous
13 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP