jQuery-ui dialog automatically gets z-index
I think jquery dialog or modals are meant to float over all elements to serve its purpose. All the same you can try adding !important
to the z-index css property of the tools
element(s).
Example
.tools{
z-index:40000 !important;
}
If it does not solve the situation, then you can simply extend the jquery dialog plugin and overwrite the behavior of automatically setting the z-index to be the largest of all.
Omid
Contact me on facebook or visit my website and WebAdvice
Updated on September 27, 2022Comments
-
Omid over 1 year
I have an element named
tools
withz-index: 400000
. I want it to be on the top of all elements always. In addition there is a jQuery-ui dialog on the same page with options:$("#dialog").dialog({ stack: false, zIndex: 1000 });
first time that dialog opens i can see the
tool
element on top but since it closed and and open again, the dialog gets400001
z-index automatically.how to solve this ?
-
Omid over 11 yearsDon't need test, adding
!important
will not solve the problem at all. but have thought about extending the plugin myself, Nevertheless i'll wait for more solutions because editing plugin is unwarranted. -
Omid over 11 yearsYou're right, but tools has
absolute
position, it really works in your demo but not sure why it behave another way in my program -
charlietfl over 11 yearsthere must be some other code causing the z-index change. jQueryUI doesn't seem to do it as witnessed in fiddle demo. Even placing
tool
dead center where dialog is , tools is visible -
Omid over 11 yearsYes, What i see is that it's working correctly, i'm just wonder if the
jQuery-ui
library is not the same, i'm using 1.9.2 (last version) -
Omid over 11 yearsThe strange issue is that each time i open the dialog in my program
z-index
grows up (Using Firebug), but in your demo no such thing happens. -
charlietfl over 11 yearscan you post link to live page? I don't think is jQueryUI doing it
-
Omid over 11 yearsLive page needs authentication, how can i send you a private message ?
-
charlietfl over 11 yearscould find an empty chat room and let me know which one it is
-
Omid over 11 years
-
Ken about 11 yearsI had a case where the top of a dialog was hidden behind a css menu. the tools class did not work for me but setting z-index on .ui-front did.
-
likeitlikeit about 11 yearsin the current version of 1.9.3, adding
!important
actually fixed the issue.