开发者

Why choose SimpleModal over jQuery UI Dialog?

开发者 https://www.devze.com 2023-03-12 10:08 出处:网络
New to Javascript/jQuery. I was looking for a good popup solution then I found the jQuery plugin SimpleModal, from Eric Martin, which seemed to 开发者_StackOverflow社区be quite popular. I am curious a

New to Javascript/jQuery. I was looking for a good popup solution then I found the jQuery plugin SimpleModal, from Eric Martin, which seemed to 开发者_StackOverflow社区be quite popular. I am curious as to why people would choose plugins like SimpleModal over the jQuery UI Dialog. What are the pros and cons when comparing the two? Thanks.


Here was my response to someone on Twitter with a similar question:

it really depends on your needs. @SimpleModal is more of a clean slate to build from and establish your own look and feel.

Others have summed up the pros and cons quite well. I call SimpleModal a modal dialog framework. It gives you the bare-bones to create modal dialogs that fit your needs.

However, jQuery UI is an awesome library and if you are using other jQuery UI components, want the styling "out of the box", or want to use the theming ability, it's a great choice as well!


I haven't personally used SimpleModal, but it looks like it is more of a lightweight solution. Instead of using the bulky jQuery UI (bulky, that is if you are only using it for a dialog), then it would be much faster to send clients JS for a simple modal to display messages.

Here is a breakdown:

jQueryUI:

  • Great if you are using many of its components, such as the dialog, datepicker, drag and drop, etc...
  • Maintains a uniform and clean look across all of your AJAX components
  • Bulky if only used for one of its components

SimpleModal:

  • Less JS, CSS, and images to send to user, relieving some server resources, and client download time
  • Great choice if you are only using AJAX for dialogs on your site
  • Not so consistent with the look and feel of other jQuery components, if you plan to integrate more, such as a date-picker

In the end, it is really up to you, but here are some pointers.

Hope that helps.


There are pros & cons to each...

jQueryUI gives you a whole bunch of tools with a whole bunch of configuration options. jQueryUI also gives you themes that can be applied to all the tools. You are not required to install the entire jQueryUI library in order to use one component, so bulk should not be an issue. However, I think with all the options comes a steeper learning curve.

Individual plugins tend to be more of a complete solution out-of-the-box, IMHO. Some plugins are well written and some are a mess. You'll have to research each and test the demos thoroughly. You may have to configure them and tweak the CSS to your liking but I think when you pick a quality plugin such as SimpleModal, you're a lot closer to a final working product than if you started with jQueryUI.


Just use what you need. Do you need the entire JQuery UI framework or do you need a modal popup?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号