Giter Site home page Giter Site logo

Comments (6)

kylefox avatar kylefox commented on June 30, 2024

Please post a publicly viewable example demonstrating the problem — thanks!

from jquery-modal.

mdmoura avatar mdmoura commented on June 30, 2024

Here it is: http://codepen.io/mdmoura/pen/wmtlf

I tested it in Firefox and when I click the open button for the second time I get the error:

Error: TypeError: this.blocker is undefined
Source File: http://kylefox.ca/jquery-modal/jquery.modal.min.js
Line: 7

There is something else strange: I have showClose: false but the close button is still generated by Modal.

So I keep ending with two close buttons on the modal ... Am I missing something?

from jquery-modal.

kylefox avatar kylefox commented on June 30, 2024

Here's a fixed version of your example: http://codepen.io/anon/pen/vyquB

The problem stems from the same issue as the other issue you posted — you can't use both rel="modal:open" and manually open a modal with JavaScript. You need to use one or the other. That was why you couldn't open the modal twice, and it's also why the close button was still appearing.

from jquery-modal.

mdmoura avatar mdmoura commented on June 30, 2024

Got it ... A suggestion: why not use CSS to define the opacity, color and z-indez of the overlay?

I think it is easier to integrate that into the projects as sometimes variables are used for colors (skins) and z-indexes (to organize the z-index order of various elements)

from jquery-modal.

kylefox avatar kylefox commented on June 30, 2024

I went with CSS because I wanted as much functionality included in the Javascript as possible so that there was minimal external CSS required. But it's not a bad idea using pure CSS.

from jquery-modal.

mdmoura avatar mdmoura commented on June 30, 2024

IMHO, pure CSS is better because the styling is separated and it is easier to adapt to every project.

When I read "Most plugins I've found try to do too much, ..." I decided to use your plugin.

What is missing is pure CSS ... IMHO I would remove overlay, opacity and zIndex from the plugin.
I would add to a .Overlay CSS class and would allow to change the class name on the plugin options.

And if this was my work I would even remove the auto generated Close button, so closeText and showClose.

I would remove because your solution "< a href="#close" rel="modal:close" >Close window< /a >" is really elegant and so easy to implement so why having an option to auto generate a close button when its placement in the markup will be useless most of the time? The close button is placed at the end of the modal window ... Most of times it is used a cross on top right.

Well, but this is just my idea ... I tend to use and develop simple plugins ...

They are the only ones that can adapt to projects which can vary a lot.

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.