How Can I Create a Curved Menu Like Stacks in OS X Using jQuery UI or CSS and JavaScript

0 votes
Can you tell me How Can I Create a Curved Menu Like Stacks in OS X Using jQuery UI or CSS and JavaScript?
Mar 11 in Java-Script by Ashutosh
• 23,230 points
133 views

1 answer to this question.

0 votes

You can create a curved menu like Stacks in OS X using CSS and JavaScript (jQuery UI for animations).

Approach:

Use CSS for layout and transformation to position items in a curved manner.

Use jQuery for hover effects or expanding animations.

Example Code:

HTML

<div class="stack">

  <img src="icon1.png" class="menu-item">

  <img src="icon2.png" class="menu-item">

  <img src="icon3.png" class="menu-item">

</div>


CSS (Curved Layout)

.stack {

  position: relative;

  width: 100px;

}

.menu-item {

  position: absolute;

  bottom: 0;

  left: 0;

  transition: transform 0.3s ease;

}

.menu-item:nth-child(1) { transform: rotate(-30deg) translateY(-10px); }

.menu-item:nth-child(2) { transform: rotate(-15deg) translateY(-20px); }

.menu-item:nth-child(3) { transform: rotate(0deg) translateY(-30px); }

.stack:hover .menu-item { transform: rotate(0) translateY(-50px); }


jQuery (For Smooth Expansion)

$(".stack").hover(function(){

  $(this).find(".menu-item").each(function(index){

    $(this).animate({ bottom: (index + 1) * 20 + "px" }, 300);

  });

}, function(){

  $(this).find(".menu-item").animate({ bottom: "0px" }, 300);

});

answered Mar 11 by Sanvi

Related Questions In Java-Script

0 votes
2 answers

How can I set a session var using javascript and get it via php code?

Yes it is possible. You can either ...READ MORE

answered Aug 9, 2020 in Java-Script by Okugbe
• 280 points
29,369 views
0 votes
1 answer

How to open a URL in a new Tab using JavaScript or jQuery?

Hello @kartik, Use window.open(): var win = window.open('http://edureka.co/', '_blank'); if (win) ...READ MORE

answered Aug 25, 2020 in Java-Script by Niroj
• 82,840 points
6,575 views
0 votes
0 answers

How can I create a two dimensional array in JavaScript?

Is it possible to create a two-dimensional ...READ MORE

May 9, 2022 in Java-Script by Kichu
• 19,040 points
829 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28, 2020 in Java-Script by Niroj
• 82,840 points
19,488 views
0 votes
1 answer

How to Center a Single-Column Div Within a 12-Column Container in Bootstrap 3?

Using Bootstrap's Offset Classes Bootstrap 3 provides offset ...READ MORE

answered Mar 11 in Node-js by Tanvi
62 views
0 votes
1 answer
0 votes
1 answer

How can I properly format a date in JavaScript?

You can format a date in JavaScript ...READ MORE

answered Jan 10 in Java-Script by anonymous
123 views
0 votes
1 answer

How can I iterate through the properties of a JavaScript object?

You can iterate through the properties of ...READ MORE

answered Jan 10 in Java-Script by Navya
124 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