23 января 2008 ~ 4088 Комментариев

Легкие диалоговые окна

dd 

Хочу поделиться с вами маленьким скриптиком для создания простых всплывающих окон: подсказок, ошибок, да чего угодно.

Скрипт представляет из себя три с половиной килобайт кода. Оформление блоков настраивается с помощью css — так что поставил скрипт и забыл ;-)

Необходимая вещь для минималистов вроде меня, это, вполне реальная, замена громоздким библиотекам.

Использование dialog box

Подключаем сам скрипт и его оформление, вставив следующий код между тегами <head></head>:

<link rel="stylesheet" type="text/css" href="dialog_box.css" />
<script type="text/javascript" src="dialog_box.js"></script>

Окно вызывается при помощи функции showDialog

showDialog('Заголовок','Содержание блока','Имя блока(используется для оформления)')

Пример со ссылкой:

<a href="#" onclick="showDialog('Ошибка','Ошибка и в Африке ошибка :-).','error')">Ошибиться</a>

Используйте на здоровье! ;-)

Посмотреть пример использования

Скачать готовый пример(обновлено 28 апреля)

Исходный текст(английский)

4088 Комментариев для “Легкие диалоговые окна”

  1. Soider 23 апреля 2008 at 21:05 Permalink

    Кайф ) Классные =)

  2. Andy 23 апреля 2008 at 22:10 Permalink

    Я дико извиняюсь, но где бы сам скрипт глянуть?

  3. Я собственной персоной 23 апреля 2008 at 22:44 Permalink

    Я дико извиняюсь, но где бы сам скрипт глянуть?

    Вроде же ссылки дал ;-)

  4. Горбунов Олег 24 апреля 2008 at 0:08 Permalink

    Это не диалоговые окна, а информационные. :) Ибо диалога с пользователем они не ведут )))

  5. Zeboton 24 апреля 2008 at 14:59 Permalink

    В примере есть ссылка «Подтвердиться». Но в открывающемся «окне» нет никаких кнопок кроме как закрыть.
    Вопрос.
    Можно ли в отрывающемся «окне» делать кнопки? И если да, то как их потом обрабатывать.

    P.S.
    Скрипт не смотрел, так как нужно срочно уходить.

  6. Я собственной персоной 24 апреля 2008 at 15:29 Permalink

    В примере есть ссылка «Подтвердиться». Но в открывающемся «окне» нет никаких кнопок кроме как закрыть.
    Вопрос.
    Можно ли в отрывающемся «окне» делать кнопки? И если да, то как их потом обрабатывать.

    P.S.
    Скрипт не смотрел, так как нужно срочно уходить.

    Возможно прописывать в тело окна кнопки, и обрабатывать их любым способов будь то javasctipt или просто get-запрос — все зависит от Вашей сообразительности ;-)

  7. Cyprezz 24 апреля 2008 at 17:11 Permalink

    Спасибо боьшое – помог сабж :)
    Фотки при клике удобнее так показывать, чем во всплывающих окнах ;)

  8. Артём Курапов 24 апреля 2008 at 20:21 Permalink

    Мне больше нравятся маленькие как в гугле – не так бросаются в глаза + на них не обязательно реагировать и закрывать

  9. Я собственной персоной 24 апреля 2008 at 20:24 Permalink

    Мне больше нравятся маленькие как в гугле – не так бросаются в глаза + на них не обязательно реагировать и закрывать

    Но иногда надо заставить пользователя обратить на что-то внимание, как бы это ужасно не звучало…

  10. wsr 28 апреля 2008 at 19:12 Permalink

    В IE6 замечен баг с тегом и этими диалоговыми окнами…
    select всегда поверх этого диалогового окна. Это очень удручает… Когда уже этот устаревший браузер умрет… Кто знает как поправить?

  11. Я собственной персоной 28 апреля 2008 at 19:45 Permalink

    В IE6 замечен баг с тегом и этими диалоговыми окнами…
    select всегда поверх этого диалогового окна. Это очень удручает… Когда уже этот устаревший браузер умрет… Кто знает как поправить?

    Автор обновил скрипт, попробуйте скачать новую версию.
    Возможно там проблема уже решена, ссылку в посте поправил.

  12. wsr 29 апреля 2008 at 16:47 Permalink

    Решение было принято отнюдь не однозначное.
    В конец body добавлялся прозрачный iframe покрывающий всю видимую область контента и скрывающий select с глаз долой. Ну IE6 и прико-о-ол :)

    Решение найдено в исходниках ThickBox 3.1 (http://jquery.com/demo/thickbox/) ;-)

  13. Я собственной персоной 29 апреля 2008 at 18:18 Permalink

    wsr, спасибо что отписались, думаю многие читатели будут благодарны Вам за эту наводку ;-)

  14. kydapodatsya 20 августа 2008 at 8:32 Permalink

    вот если бы еще перетаскивать их можно было

  15. Александр 2 октября 2009 at 17:49 Permalink

    И «Легкие диалоговые окна» плавно превратились в Ajax :)

  16. Антон 4 ноября 2010 at 3:17 Permalink

    Огромное спасибище автору за такую вещь!
    Ибо стандартные окна, выскакивающие (в прямом смысле слова) на пользователя, уже попросту раздражают. Хотелось чего-то более элегантного… =))) В общем, ещё раз спасибо, пойду юзать в своём блоге! :))

  17. Health Information 25 февраля 2012 at 18:22 Permalink

    good article, my partner and i undoubtedly enjoy this site, go on this

  18. Van Ubl 26 февраля 2012 at 8:58 Permalink

    I simply want to tell you that I’m very new to blogging and site-building and really loved your blog. Likely I’m planning to bookmark your website . You certainly have excellent well written articles. Thanks a lot for revealing your web page.

  19. Best Snap and Shoot Digital Camera 26 февраля 2012 at 21:17 Permalink

    Wow, amazing blog site structure! The length of time are you currently writing a blog with regard to? you create blogging look straightforward. The general search of your respective internet site is fantastic, plus the content material!…

  20. Johnsie 29 февраля 2012 at 10:03 Permalink

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.

  21. Williams 29 февраля 2012 at 12:59 Permalink

    This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

  22. montre gps 29 февраля 2012 at 16:54 Permalink

    But wanna remark that you have a very decent web site , I enjoy the design it really stands out.

  23. white ceramic watches 29 февраля 2012 at 18:25 Permalink

    I regard something really special in this site.

  24. Buy xrumer list 29 февраля 2012 at 18:59 Permalink

    There is clearly a great deal to know about this. I believe you produced various very good points in capabilities also.

  25. disque dur ssd 29 февраля 2012 at 20:26 Permalink

    You are my inhalation , I have few blogs and occasionally run out from to brand : (.

  26. barbecue electrique 29 февраля 2012 at 21:35 Permalink

    Awsome post and straight to the point. I am not sure if this is truly the best place to ask but do you guys have any ideea where to employ some professional writers? Thx :)

  27. camescope hd 1 марта 2012 at 1:50 Permalink

    Very interesting points you have noted, thank you for putting up.

  28. Gregory 1 марта 2012 at 3:34 Permalink

    I do not even know how I ended up here, but I thought this post was great. I don’t know who you are but certainly you are going to a famous blogger if you are not already

  29. Mann 1 марта 2012 at 4:24 Permalink

    You made some decent points there. I looked on the internet for the issue and found most individuals will go along with with your website.

  30. dumpster rental in campo ca 1 марта 2012 at 5:38 Permalink

    To the level and penned well, thanks for your data

  31. chaussure de foot 1 марта 2012 at 7:36 Permalink

    Regards for all your efforts that you have put in this. very interesting information. «The worth of a book is to be measured by what you can carry away from it.» by James Bryce.

  32. http://select-restaurant.net/ 1 марта 2012 at 8:33 Permalink

    You developed some decent points there. I looked on the net for any dilemma and located most individuals goes along with together together with your website.

  33. vps hosting 1 марта 2012 at 9:21 Permalink

    I do believe all of the concepts you have offered on your post. They’re really convincing and can certainly work. Still, the posts are too short for novices. May just you please prolong them a bit from next time? Thanks for the post.

  34. compensation consulting firm 1 марта 2012 at 11:10 Permalink

    Great ¡V I should certainly pronounce, impressed with your website. I had no trouble navigating through all tabs and related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or anything, web site theme . a tones way for your client to communicate. Nice task..

  35. velo enfant pas cher 1 марта 2012 at 14:58 Permalink

    You have noted very interesting details ! ps nice internet site . «We make ourselves a ladder out of our vices if we trample the vices themselves underfoot.» by Saint Augustine.

  36. climatiseur mobile 1 марта 2012 at 14:58 Permalink

    You are a very bright individual!

  37. web design columbus ga 1 марта 2012 at 16:11 Permalink

    I am not sure where you’re getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for excellent information I was looking for this info for my mission.

  38. list free proxy 1 марта 2012 at 17:44 Permalink

    There is noticeably plenty of dollars to comprehend this. I suppose you created specific good points in functions also.

  39. Ileana Shackley 1 марта 2012 at 19:13 Permalink

    It’s vital to get yourself a specialized decides your buzzing in the ears before you begin getting rid of them. The majority of the ringing in the ears will also be suggestive of more severe concerns. Furthermore, when the examination is just not ringing ears, then you will want to help medicate or treat it in a very different fashion than you should ringing in the ears. Lots of people that have ringing ears come across respite from their own issue by utilizing noise treatment method. There is a straightforward try that you may concept when appear treatment method will help you manage the ringing in ears. Tune your own airwaves between not one but two stations. You need to notice a new stationary appear for those who have tuned the idea among areas. Should the fixed sound through the radio stations goggles the tinnitus as well as makes it less obvious (partially covers the idea), subsequently audio therapy is likely to help your condition.

  40. auto insurance questions 1 марта 2012 at 20:14 Permalink

    Hi, Neat post. There’s a problem together with your web site in web explorer, could check this¡K IE nonetheless is the market chief and a good part of other people will omit your fantastic writing because of this problem.

  41. machine a biere 1 марта 2012 at 22:19 Permalink

    I really like your writing style, great information, appreciate it for putting up : D.

  42. trampoline avec filet pas cher 1 марта 2012 at 23:45 Permalink

    You are my breathing in, I own few blogs and rarely run out from to brand.

  43. click here 2 марта 2012 at 0:04 Permalink

    I do trust all of the concepts you have presented in your post. They are very convincing and will certainly work. Nonetheless, the posts are very brief for starters. May just you please lengthen them a little from next time? Thank you for the post.

  44. site 2 марта 2012 at 0:16 Permalink

    I do trust all of the concepts you’ve introduced for your post. They’re really convincing and can definitely work. Still, the posts are too short for beginners. May you please lengthen them a little from subsequent time? Thank you for the post.

  45. montre hello kitty 2 марта 2012 at 1:21 Permalink

    You have observed very interesting points! ps nice internet site.

  46. Issac Maez 2 марта 2012 at 4:16 Permalink

    WONDERFUL Post.thanks for share..more wait .. …

  47. Agueda 2 марта 2012 at 7:02 Permalink

    Oh my goodness! an amazing article dude. Thank you However I am experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting identical rss problem? Anyone who knows kindly respond. Thnkx

  48. watch spongebob online 2 марта 2012 at 10:03 Permalink

    I’d have to check with you here. Which isn’t something I often do! I get pleasure from studying a post that can make individuals think. Also, thanks for allowing me to comment!

  49. disque dur externe pas cher 2 марта 2012 at 11:10 Permalink

    Some truly quality articles on this website , bookmarked .

  50. sac à langer 2 марта 2012 at 12:44 Permalink

    Its great as your other articles : D, thankyou for posting . «In the spider-web of facts, many a truth is strangled.» by Paul Eldridge.


Оставить комментарий