GithubHelp home page GithubHelp logo

Comments (9)

pr7vinas avatar pr7vinas commented on May 18, 2024

I did not know this line of code was needed.
$(html).appendTo('body').modal();

So it's settled, although I do not think this is an elegant solution. Is there another way?

from jquery-modal.

kylefox avatar kylefox commented on May 18, 2024

Do you have a publicly viewable test case?

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

I'm having a similar problem with z-indexes when trying to set them higher than the default. I need to do some z-index manipulation on my existing design, so if I extend the defaults and set the zIndex: 10, for instance. Then the overlay works to properly cover my other elements that had 1-9 z-indexes set, but the modal (even though it has a z-index of 11, since it takes the set zindex and increments it by 1) isn't positioned above the overlay. I tried to do this with CSS first using !important to set the z-index of the elements (which also didn't work), so then I thought I'd try dropping to JS to actually change the initial value. Still not dice.

I'm using this code through the https://github.com/dei79/jquery-modal-rails gem and setting the z-index as such:

modal_customizations= {
  zIndex: 10,
}
$.extend($.modal.defaults, modal_customizations)

The z-index does get set properly for the overlay at 10 and the modal at 11, it's just that the modal, even with the higher z-index doesn't show up on top of the overlay.

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

Apparently this bug is a duplicate of #44

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

@pr7vinas can you explain a little more how you use that code you referenced?

$(html).appendTo('body').modal();

Do you execute that when opening the modal I imagine?

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

I think this pull request gets me fixed up dei79/jquery-modal-rails#14

from jquery-modal.

pr7vinas avatar pr7vinas commented on May 18, 2024

@jondkinney Sorry for the delay to reply.
This line of code is referenced in the documentation. This line is putting the modal at the end of the body, avoiding any problem with index. Yes I run this every time I need to show the modal. The jquery-modal will remove it automatically when the user closes the modal.

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

@pr7vinas thanks for getting back to me. I'm a bit confused though, are you saying you run that line of code manually when executing the code to show the modal? For me, baking it into that line in the pull request fixed it globally... is that a solution you want to explore? Perhaps I'm missing something though. Thanks!

from jquery-modal.

jondkinney avatar jondkinney commented on May 18, 2024

@pr7vinas any clarification on this? Again, I needed to alter the gem to make this work... is there a way to achieve this without needing to alter the gem? If not, it seems like that pull request should be merged, right?

Thanks much

from jquery-modal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.