0

The submenu shows to the right and is off of the screen when there is plenty of room to pop open on the left. how can i implement the feature that allows submenu to appears to the left rather than right by first checking to see where the menu should appear

Here are the images to show what i exactly mean. (This is typical windows right-click on desktop taken for example)

Submenu on left when there is no room on right

In this image, submenu is opening on left knowing that there is no room on right side.

Submenu on right When there is room on right

In this image, submenu is opening on left knowing that there is room on left side.

I want to implement feature like this.

So, how i can achieve this? I tried tweaking my CSS with this

.sf-menu > li:last-child > ul ul {
  left: auto; // reset the default positioning
  right: 100%; // this makes the submenu fly out to the left
}

with Supposition Plugin written by Joel Birch

this solves it. but i can't use this plugin in my work.

is there any other way to do it ?

S J
  • 3,210
  • 1
  • 22
  • 32

0 Answers0