Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/topic.php on line 737
Форумы портала PHP.SU :: Вызов окна по условию

 PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи


 Страниц (3): [1] 2 3 »   

> Описание: Как вызвать модальное окно jquery по условию?
quinlena
Отправлено: 19 Июля, 2012 - 07:40:46
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




Всем добрый день! Подскажите, как сделать вызов модального окна по условию? Вызываю вот так:
PHP:
скопировать код в буфер обмена
  1.         else {echo "
  2.         <link href=\"css/base.css\" rel=\"stylesheet\" />
  3.         <link href=\"css/jmodal.css\" rel=\"stylesheet\" />
  4.        
  5.         <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></script>
  6.         <script type=\"text/javascript\" src=\"js/jmodal.js\"></script>
  7.         <script type=\"text/javascript\">
  8.        
  9.                
  10.                         $.jModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
  11.         </script>
  12.          ";}
  13.                
  14.                 }

Ничего не выходит(((( Помогите, пожалуйста!
 
 Top
Иван14
Отправлено: 19 Июля, 2012 - 08:50:50
Post Id



Гость


Покинул форум
Сообщений всего: 111
Дата рег-ции: Авг. 2011  
Откуда: Владивосток


Помог: 0 раз(а)





CODE (html):
скопировать код в буфер обмена
  1. <link href="css/base.css" rel="stylesheet" />
  2.         <link href="css/jmodal.css" rel="stylesheet" />


CODE (javascript):
скопировать код в буфер обмена
  1.        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  2.         <script type="text/javascript" src="js/jmodal.js"></script>
  3.         <script type="text/javascript">
  4.        
  5.                
  6.                         $.jqModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
  7.         </script>

PHP:
скопировать код в буфер обмена
  1.  <?PHP }
  2.                
  3.                 }?>


ну и у вас ошибка была не $.jModal а $.jqModal.. пробуйте.. и не извращайтесь никогда так над кавычками )

(Отредактировано автором: 19 Июля, 2012 - 08:51:57)

 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 09:09:16
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




[quote=Иван14][/quote]
Все равно не работает((
(Добавление)
Иван14 пишет:
CODE (html):
скопировать код в буфер обмена
  1. <link href="css/base.css" rel="stylesheet" />
  2.         <link href="css/jmodal.css" rel="stylesheet" />


CODE (javascript):
скопировать код в буфер обмена
  1.        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  2.         <script type="text/javascript" src="js/jmodal.js"></script>
  3.         <script type="text/javascript">
  4.        
  5.                
  6.                         $.jqModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
  7.         </script>

PHP:
скопировать код в буфер обмена
  1.  <?PHP }
  2.                
  3.                 }?>


ну и у вас ошибка была не $.jModal а $.jqModal.. пробуйте.. и не извращайтесь никогда так над кавычками )

Исправила, все равно окошко не показывает. В чем еще может быть причина?
 
 Top
Иван14
Отправлено: 19 Июля, 2012 - 09:15:17
Post Id



Гость


Покинул форум
Сообщений всего: 111
Дата рег-ции: Авг. 2011  
Откуда: Владивосток


Помог: 0 раз(а)




quinlena пишет:
Исправила, все равно окошко не показывает. В чем еще может быть причина?

могу вам посоветовать ссылку http://jquerylist[dot]ru/modal-windows/jqmodal[dot]html читайте внимательно.. разбирайтесь.. слишком мало кода, не могу однозначно сказать в чём ошибка
 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 09:17:13
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




Иван14 пишет:
quinlena пишет:
Исправила, все равно окошко не показывает. В чем еще может быть причина?

могу вам посоветовать ссылку http://jquerylist[dot]ru/modal-windows/jqmodal[dot]html читайте внимательно.. разбирайтесь.. слишком мало кода, не могу однозначно сказать в чём ошибка

У меня не jqModal, а просто jModal.
Вот весь код файла пхп
PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. if(isset($_GET['forcli'])){
  3. header("Content-type: text/html; charset=windows-1251");
  4. $sql = mysql_connect("localhost","root","");
  5. mysql_select_db("vol_base");
  6. $pz1 = $_GET['q'];
  7. $pz = iconv("UTF-8", "WINDOWS-1251", $pz1);
  8. $client=mysql_query("SELECT * FROM persons WHERE ud_per='0' and last_name LIKE '$pz%'");
  9. while ($st= mysql_fetch_array($client))
  10. {      
  11. echo urldecode($st['last_name'].' '.$st['first_name'])."\r\n";
  12. }
  13. die();
  14. }
  15. else
  16. {
  17.  
  18. header("Content-type: text/html; charset=utf-8");
  19. include_once("./common.php");
  20. if (isset($_SESSION['login'])){
  21. $fname = './tpl/users_sysexit.html';
  22. $fcontent = file_get_contents($fname);
  23. $link = _mysql_connect("vol_base");
  24. $text = file_get_contents('ser.txt');
  25. $id=(int)$_GET['id'];
  26.         $id=$_GET['id'];
  27.           $cl_r=mysql_query("SELECT `last_name`,`first_name`,`id_person`  FROM `persons` WHERE `id_person`='".$id."'",$link);
  28.           $cl_r=mysql_fetch_assoc($cl_r);
  29.           replace_vars("{person}",$cl_r['last_name'].' '.$cl_r['first_name']);
  30. if(isset($_POST['act']) == "insert"){
  31.                 $login = addslashes($_POST['login']);
  32.                 $pas = addslashes(md5(md5($_POST['pas']).$text));
  33.                 $us=mysql_query("SELECT `id_user`, `login` FROM `users_sys` WHERE `login`='".$_SESSION["login"]."'");
  34. $user=$us['id_user'];
  35. $gr=intval($_POST['name_gr']);
  36. $per=explode(' ',addslashes($_POST['autocomplete1']));
  37. $last=$per[0];
  38. $query = "SELECT id_person FROM persons WHERE last_name = '".$per[0]."' and first_name = '".$per[1]."'";
  39.         if(!mysql_query($query,$link)){
  40.                 echo mysql_error();
  41.                 exit;}
  42.                 else{
  43.                                
  44. $requ=mysql_query($query,$link);
  45. if (!$requ) echo mysql_error();
  46. $client=mysql_fetch_array($requ);
  47. $per=$client['id_person'];}
  48. $dubl= mysql_fetch_array(mysql_query ("SELECT COUNT(*) as coun FROM  `users_sys` WHERE `id_person`='".$per."' AND `ud_us`='0'"));
  49. $coun=$dubl['coun'];
  50. if ($coun=='0') {                      
  51.                 $sql = sprintf("INSERT INTO `users_sys` (`login`,`pas`,`id_group`,`id_person`,`id_user_rec_update`,`last_name`)
  52.                         VALUES ('%s','%s','%d','%d','%d','%s')",
  53.                         $login,
  54.                         $pas,
  55.                         $gr,
  56.                         $per,
  57.                         $user,
  58.                         $last
  59.                         );
  60. //echo $sql;die();
  61.         if(!mysql_query($sql,$link)){
  62.                 echo mysql_error();
  63.         }}
  64.        
  65.         else { ?>
  66.  
  67.         <link href="css/base.css" rel="stylesheet" />
  68.         <link href="css/jmodal.css" rel="stylesheet" />
  69.         <script type="text/javascript" src="js/jmodal.js"></script>
  70.         <script type="text/javascript">
  71.                         $.jModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
  72.         </script>
  73.                 <?PHP }
  74.                
  75.                 }
  76.  
  77. elseif(isset($_POST['act']) == "update"){
  78.        
  79.         $sql = "UPDATE `users_sys` SET `login`='".$login."',`pas`='".$pas."',`id_user_rec_update`='".$user."'``=''";
  80. }else{
  81.         $fm_own =  mysql_query("SELECT `id_group`,`name_gr` FROM `users_gr` WHERE `ud_gr`='0'",$link);
  82.         $own_options = '';
  83.         while($row = mysql_fetch_array($fm_own)){
  84.         $own_options .= "<option value='".$row['id_group']."'>".$row['name_gr']."</option>";
  85.         }
  86.         $content = replace_vars("{name_options} ",$own_options);
  87.         replace_vars("{выход}",$_SESSION['login']);
  88.         $content = replace_vars("{action}","insert");
  89.        
  90.        
  91.        
  92. }
  93. if(isset($_POST['act']) && $_POST['act'] == "add_gr"){
  94. $name_gr = addslashes($_POST['new_gr']);
  95. $sql = "INSERT INTO `users_gr` (`name_gr`)
  96. VALUES('".$name_gr."')";
  97. if(mysql_query($sql,$link)){
  98. $group = mysql_query("SELECT `id_group`,`name_gr` FROM
  99. `users_gr`",$link);
  100. $own_options = '';
  101. while($row = mysql_fetch_array($group)){
  102. $own_options .= "<option
  103. value='".$row['id_group']."'>".$row['name_gr']."</option>";
  104. }
  105. echo $own_options;
  106. die();
  107. }
  108. }
  109. else{
  110.  
  111. echo $fcontent;
  112.  
  113. }
  114.  
  115. }
  116. }
  117. if (!isset($_SESSION['login'])){
  118.         header("Location: login.php");
  119. }
  120. ?>

(Добавление)
Вот такой файл jmodal
CODE (javascript):
скопировать код в буфер обмена
  1. /*
  2.  * jModal
  3.  *
  4.  * author: Jurii Tarahonich aka Sofcase
  5.  * author page: http://sofcase.net/
  6.  
  7.  * function options: width, open, close
  8.  */
  9.  
  10. (function($) {
  11.         $.jModal = function(header, content, options) {
  12.                 options = $.extend({
  13.                         width: '400px'
  14.                 }, options);
  15.  
  16.                 var fader = $('#jm-fader');
  17.                 var container = $('#jm-container').css('width', options.width);
  18.        
  19.                 var headerContainer = $('#jm-container > .jm-header');
  20.                 var contentContainer = $('#jm-container > .jm-content');
  21.                 var closeButton = $('#jm-container > .jm-close');
  22.        
  23.                 // проверяем оверлей и показываем его
  24.                 if (fader.length) {
  25.                         fader.css({
  26.                                 opacity: .35,
  27.                                 height: $(document).height()
  28.                         }).show();
  29.                 } else {
  30.                         if (console && console.error) {
  31.                                 console.error('[jModal] #jm-fader контейнер не найден.');      
  32.                         }
  33.                         return false;
  34.                 }
  35.        
  36.                 // проверяем все ли части модального окна есть
  37.                 if (!container.length && !headerContainer.length && !contentContainer.length && !closeButton.length) {
  38.                         if (console && console.log) {
  39.                                 console.error('[jModal] Нехватает некоторых контейнеров модального окна.');
  40.                         }
  41.                         return false;
  42.                 }
  43.        
  44.                 // настраиваем модальное окно
  45.                 headerContainer.text(header);
  46.                 contentContainer.html(content);
  47.        
  48.                 // центрируем и показываем модальное окно
  49.                 container.show().css({
  50.                         top: (parseInt($(window).height()) / 2) - (parseInt(container.height()) / 2)
  51.                 }).animate({left: (parseInt($(document).width()) / 2) - (parseInt(options.width) / 2)}, 350, function () {
  52.                         // если есть коллбек на открытие, выполняем его
  53.                         if (typeof options.open != 'undefined') {
  54.                                 options.open.call(container);
  55.                         }
  56.                 });
  57.        
  58.                 // вешаем закрытие окна на кнопку закрыть
  59.                 closeButton.one('click', function() {
  60.                         container.animate({left: '-1000px'}, 350, function() {
  61.                                 this.style.display = 'none';
  62.                                 fader.hide();
  63.                        
  64.                                 if (typeof options.close != 'undefined') {
  65.                                         options.close.call(container);
  66.                                 }
  67.                         });
  68.                 });
  69.        
  70.                 // и клавишу Escape
  71.                 $(document).one('keydown', function(e) {
  72.                         if (e.keyCode == 27) {
  73.                                 container.animate({left: '-1000px'}, 350, function() {
  74.                                         this.style.display = 'none';
  75.                                         fader.hide();
  76.                        
  77.                                         if (typeof options.close != 'undefined') {
  78.                                                 options.close.call(container);
  79.                                         }
  80.                                 });
  81.                         }
  82.                 });
  83.        
  84.                 // если пользователь скроллит, тогда перемещаем окно
  85.                 $(window).scroll(function() {
  86.                         container.stop(true, false).animate({top: window.scrollY + (parseInt($(window).height()) / 2) - (parseInt(container.height()) / 2)}, 500);
  87.                 });
  88.        
  89.                 return true;
  90.         }
  91. })(jQuery);
 
 Top
Иван14
Отправлено: 19 Июля, 2012 - 09:27:48
Post Id



Гость


Покинул форум
Сообщений всего: 111
Дата рег-ции: Авг. 2011  
Откуда: Владивосток


Помог: 0 раз(а)




я не вижу вашего тела документа...
1.если вы уверены что файлы :
CODE (html):
скопировать код в буфер обмена
  1. <link href="css/base.css" rel="stylesheet" />
  2. <link href="css/jmodal.css" rel="stylesheet" />

подключаются в <head>, тогда
2. elseif(isset($_POST['act']) == "update"){ ... else if раздельно
CODE (javascript):
скопировать код в буфер обмена
  1. 3. попробуйте этот код:
  2. $.fn.jmodal({  
  3.     title: 'Information',  
  4.     content: 'Hi,you displayed me?',  
  5.     buttonText: 'Yes,It\'s me',  
  6.     okEvent: function(e) {  
  7.        alert('jmodal\'ll be closed after u click me:-)');  
  8.     }  
  9.  });

Если он сработает, ищите в своем ошибку...
 
 Top
tuareg
Отправлено: 19 Июля, 2012 - 09:32:17
Post Id


Участник


Покинул форум
Сообщений всего: 1234
Дата рег-ции: Июнь 2010  


Помог: 69 раз(а)




Откройте fierfox. Установите fierbug. запустите... . И смотрите там, что есть ошибки и т.д
 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 09:32:30
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




Вот так же вставить?
PHP:
скопировать код в буфер обмена
  1.         <script type="text/javascript">
  2.    $.fn.jmodal({  
  3.     title: 'Information',  
  4.     content: 'Hi,you displayed me?',  
  5.     buttonText: 'Yes,It\'s me',  
  6.     okEvent: function(e) {  
  7.        alert('jmodal\'ll be closed after u click me:-)');  
  8.     }  
  9.  });
  10.         </script>

Так не срабатывает((
Вот файл html:
CODE (html):
скопировать код в буфер обмена
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. <style type="text/css">
  7. <!--
  8. body {
  9.         margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
  10.         padding: 0;
  11.         text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
  12.         color: #000000;
  13.         background-color: #666666;
  14.         background-image: url(Widescreen__004624_.jpg);
  15.         background-repeat: no-repeat;
  16.         background-attachment: fixed;
  17.         background-size: cover;
  18.         font-family: Verdana, Arial, Helvetica, sans-serif;
  19.         font-size: 90%;
  20. }
  21. #jm-fader {
  22.    background: #888;
  23.    display: none;
  24.    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100;
  25. }
  26.  
  27. #jm-container {
  28.    background-color: #000;
  29.    padding: 10px;
  30.    width: 400px;
  31.    font-family: Ubuntu, Tahoma, Arial;
  32.  
  33.    display: none; overflow: hidden;
  34.    position: absolute; top: 0; left: -1000px; z-index: 150;
  35.  
  36.    -webkit-border-radius: 5px;
  37.    -moz-border-radius: 5px;
  38.    -o-border-radius: 5px;
  39.    border-radius: 3px;
  40.  
  41.    -webkit-box-shadow: 0px 0px 15px #333;
  42.    -moz-box-shadow: 0px 0px 15px #333;
  43.    -o-box-shadow: 0px 0px 15px #333;
  44.    box-shadow: 0px 0px 15px #333;
  45. }
  46.  
  47. div.jm-header {
  48.    font-size: 15px;
  49.    color: #fff;
  50.    margin: 0px 5px 10px;
  51. }
  52.  
  53. div.jm-content {
  54.    background-color: #fff;
  55.    font-size: 13px;
  56.    color: #454545;
  57.    padding: 10px;
  58.  
  59.    -webkit-border-radius: 3px;
  60.    -moz-border-radius: 3px;
  61.    -o-border-radius: 3px;
  62.    border-radius: 3px;
  63. }
  64.  
  65. a.jm-close {
  66.    background: url('../images/jm-close.png') center no-repeat;
  67.    width: 15px; height: 15px;
  68.    display: block; float: right;
  69.    margin: 2px 3px 0;
  70.  
  71.    -webkit-border-radius: 3px;
  72.    -moz-border-radius: 3px;
  73.    -o-border-radius: 3px;
  74.    border-radius: 3px;
  75.  
  76.    -webkit-opacity: .2;
  77.    -moz-opacity: .2;
  78.    -o-opacity: .2;
  79.    opacity: .2;
  80. }
  81.  
  82. #jm-container:hover a.jm-close {
  83.    -webkit-opacity: 1;
  84.    -moz-opacity: 1;
  85.    -o-opacity: 1;
  86.    opacity: 1;
  87. }
  88. .oneColFixCtrHdr #container {
  89.         width: 780px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
  90.         background: #FFFFFF;
  91.         margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
  92.         border: 1px solid #000000;
  93.         text-align: left; /* this overrides the text-align: center on the body element. */
  94. }
  95. .oneColFixCtrHdr #header {
  96.         padding: 0 10px 0 20px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
  97.         background-color: #006699;
  98. }
  99. .oneColFixCtrHdr #header h1 {
  100.         margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
  101.         padding: 1px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
  102. }
  103. .oneColFixCtrHdr #mainContent {
  104.         padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
  105.         background: #FFFFFF;
  106. }
  107. .oneColFixCtrHdr #footer {
  108.         padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
  109.         background:#DDDDDD;
  110. }
  111. .oneColFixCtrHdr #footer p {
  112.         margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
  113.         padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
  114. }
  115. .ac_results {
  116.         padding: 0px;
  117.         border: 1px solid WindowFrame;
  118.         background-color: Window;
  119.         overflow: hidden;
  120. }
  121. .button {
  122.         margin: 10px;
  123.         text-decoration: none;
  124.         font: bold 25px 'Trebuchet MS',Arial, Helvetica;
  125.         display: inline-block;
  126.         text-align: center;
  127.         color: #fff;
  128.         border: 1px solid #9c9c9c;
  129.         border: 1px solid rgba(0, 0, 0, 0.3);
  130.         text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  131.         box-shadow: 0 0 1px rgba(0,0,0,0.4);
  132.         -moz-box-shadow: 0 0 1px rgba(0,0,0,0.4);
  133.         -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.4);
  134.         }
  135. .button, .button span {
  136.         -moz-border-radius: 6px;
  137.         border-radius: 6px;
  138.         }
  139. .button span {
  140.         border-top: 1px solid #fff;
  141.         border-top: 1px solid rgba(100, 100, 100, 0.5);
  142.         display: block;
  143.         padding: 12px 50px;
  144.         background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
  145.                 -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
  146.                 -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05))),
  147.                 -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05)));
  148.         background-image: -moz-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
  149.                 -moz-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
  150.                 -moz-linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
  151.                 -moz-linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
  152.         -moz-background-size: 3px 3px;
  153.         -webkit-background-size: 3px 3px;
  154.         }
  155. .button:hover {
  156.         box-shadow: 0 0 1px rgba(0,0,0,0.4);
  157.         -moz-box-shadow: 0 0 1px rgba(0,0,0,0.4);
  158.         -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.4);
  159.         }
  160. .button:active  {
  161.         position: relative;
  162.         top: 1px;
  163.         }
  164. /* Голубая кнопка */
  165. .button-blue {
  166.         background: #4477a1;
  167.         background: -webkit-gradient(linear, left top, left bottom, from(#81a8cb), to(#4477a1) );
  168.         background: -moz-linear-gradient(-90deg, #81a8cb, #4477a1);
  169.         filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#81a8cb', endColorstr='#4477a1');
  170.         }
  171. .button-blue:hover {
  172.         background: #81a8cb;
  173.         background: -webkit-gradient(linear, left top, left bottom, from(#4477a1), to(#81a8cb) );
  174.         background: -moz-linear-gradient(-90deg, #4477a1, #81a8cb);
  175.         filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4477a1', endColorstr='#81a8cb');
  176.         }
  177. .button-blue:active  {
  178.         background: #4477a1;
  179.         }
  180. .ac_results ul {
  181.         width: 100%;
  182.         list-style-position: outside;
  183.         list-style: none;
  184.         padding: 0;
  185.         margin: 0;
  186. }
  187.  
  188. .ac_results iframe {
  189.         display:none;/*sorry for IE5*/
  190.         display/**/:block;/*sorry for IE5*/
  191.         position:absolute;
  192.         top:0;
  193.         left:0;
  194.         z-index:-1;
  195.         filter:mask();
  196.         width:3000px;
  197.         height:3000px;
  198. }
  199.  
  200. .ac_results li {
  201.         position:relative;
  202.    margin: 0px;
  203.         padding: 2px 5px;
  204.         cursor: pointer;
  205.         display: block;
  206.         width: 100%;
  207.         font: menu;
  208.         font-size: 12px;
  209.         overflow: hidden;
  210. }
  211. .submit {
  212.         width: 85px;
  213.         height: 27px;
  214.         padding: 0 0 2px;
  215.         font: 16px "Trebuchet MS", Tahoma, Arial, sans-serif;
  216.         outline: none;
  217.         position: relative;
  218.         cursor: pointer;
  219.         border-radius: 3px;
  220.         color: #515F6A;
  221.         text-shadow: 1px 1px #C4D0DA;
  222.         border: 1px solid #7C8A93;
  223.         border-top: 1px solid #A1AEB7;
  224.         border-bottom: 1px solid #5D6B75;
  225.         box-shadow:
  226.                 inset 0 1px #D8E0E6,
  227.                 inset 1px 0 #B7C6D1,
  228.                 inset -1px 0 #B7C6D1,
  229.                 inset 0 -1px #A1B5C4,
  230.                 0 2px #62727E,
  231.                 0 3px #5D6B75,
  232.                 0 4px 2px rgba(0,0,0,0.4)
  233.         ;
  234.         background: -moz-linear-gradient(top,  #becbd6 0%, #8da5b7 100%); /* FF3.6+ */
  235.         background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#becbd6), color-stop(100%,#8da5b7)); /* Chrome,Safari4+ */
  236.         background: -webkit-linear-gradient(top,  #becbd6 0%,#8da5b7 100%); /* Chrome10+,Safari5.1+ */
  237.         background: -o-linear-gradient(top,  #becbd6 0%,#8da5b7 100%); /* Opera 11.10+ */
  238.         background: -ms-linear-gradient(top,  #becbd6 0%,#8da5b7 100%); /* IE10+ */
  239.         background: linear-gradient(top,  #becbd6 0%,#8da5b7 100%); /* W3C */
  240.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#becbd6', endColorstr='#8da5b7',GradientType=0 ); /* IE6-9 */
  241.         background-color: #A5B8C6;
  242. }
  243. .submit::-moz-focus-inner{border:0}
  244. .submit:hover {
  245.         border-top: 1px solid #96A2AB;
  246.         box-shadow:
  247.                 inset 0 1px #C0CED7,
  248.                 inset 1px 0 #B7C6D1,
  249.                 inset -1px 0 #B7C6D1,
  250.                 inset 0 -1px #B9C8D3,
  251.                 0 2px #62727E,
  252.                 0 3px #5D6B75,
  253.                 0 4px 2px rgba(0,0,0,0.4)
  254.         ;
  255.         background: -moz-linear-gradient(top,  #97adbd 0%, #a8bac8 100%); /* FF3.6+ */
  256.         background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#97adbd), color-stop(100%,#a8bac8)); /* Chrome,Safari4+ */
  257.         background: -webkit-linear-gradient(top,  #97adbd 0%,#a8bac8 100%); /* Chrome10+,Safari5.1+ */
  258.         background: -o-linear-gradient(top,  #97adbd 0%,#a8bac8 100%); /* Opera 11.10+ */
  259.         background: -ms-linear-gradient(top,  #97adbd 0%,#a8bac8 100%); /* IE10+ */
  260.         background: linear-gradient(top,  #97adbd 0%,#a8bac8 100%); /* W3C */
  261.         filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#97adbd', endColorstr='#a8bac8',GradientType=0 ); /* IE6-9 */
  262.         background-color: #A5B8C6;
  263. }
  264. .submit:active {
  265.         top: 3px;
  266.         border: 1px solid #778998;
  267.         border-top: 1px solid #606F7A;
  268.         border-bottom: 1px solid #8296A6;
  269.         background: #92A9BA;
  270.         box-shadow: inset 0 1px 2px #5F7281;
  271. }
  272.  
  273. .ac_loading {
  274.         background : Window url('autocomplete_indicator.gif') right center no-repeat;
  275. }
  276.  
  277. .ac_over {
  278.         background-color: Highlight;
  279.         color: HighlightText;
  280. }
  281. #example {
  282.  position:absolute;
  283.  top:10px;
  284.  left:10px;
  285.  width:150px;
  286.  font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
  287.  font-size: 10pt;
  288. }
  289. #example2 {
  290.  position:absolute;
  291.  top:10px;
  292.  left:170px;
  293.  width:240px;
  294.  font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
  295.  font-size: 10pt;
  296. }
  297. .qnt {
  298.  position:absolute;
  299.  top:2px;
  300.  right:10px;
  301.  font-size:0.8em;
  302.  color:#26A908;
  303. }
  304. .style1 {
  305.         color: #000033;
  306.         font-family: "Courier New", Courier, monospace;
  307. }
  308. .styled-select select {
  309.   background: white;
  310.   width: auto;
  311.   padding: 5px;
  312.   font-size: 12px;
  313.   border: 1px solid #ccc;
  314.   height: 30px;
  315.  
  316. }
  317. .styled-select {
  318.   width: auto;
  319.   height: 30px;
  320.   overflow: hidden;
  321.   background: url(re.png) no-repeat right;
  322. }
  323. tr{list-style:none;padding: 10px 0 10px 100px;}
  324. tr td{margin-bottom: 21px;position: relative;}
  325. .textinput{
  326.     border-radius: 3px;
  327.     border: 1px solid #AAA;
  328.     padding: 3px 5px;
  329.     color: #888;
  330.     width: 140px;
  331.     box-shadow: 0px 0px 5px #CCC;
  332.     transition: all 300ms ease-in;
  333. }
  334. .textinput:hover
  335. {
  336.     border-color: #66cccc;
  337.     box-shadow: 0px 0px 6px #99ccff;
  338.     color: #666;
  339. }
  340. .textinput:focus
  341. {
  342.     border-color: #6699cc;
  343.     box-shadow: 0px 0px 6px #66ccff;
  344.     color: #333;
  345.     outline: 0;
  346. }
  347. .style5{
  348.         color:white;
  349.         font-family: "Courier New", Courier, monospace;
  350. }
  351. textarea.textinput{width: 200px;}
  352. input.checking{margin-top:20px;}
  353. label{position:absolute;left:0;top:0;}
  354. button{margin-left:100px;cursor:pointer;outline:none;}
  355. .textmessage .error{width:100px;}
  356. .error{
  357.    color:red;
  358.    padding-left: 10px;
  359.    position: absolute;
  360.    top: 0;}
  361. .thanks{text-align:center;padding-top:10px;color:green;}
  362. -->
  363. </style>
  364.  
  365. <script type="text/javascript" src="/coolmenus.js"></script>
  366.     <link href="/style.menu.css" rel="stylesheet" type="text/css" />
  367.        
  368.         <link rel="stylesheet" href="valid/css/validationEngine.jquery.css" type="text/css"/>
  369.      
  370.         <script src="valid/js/jquery-1.6.min.js" type="text/javascript">
  371.         </script>
  372.        
  373. <link rel='stylesheet' type='text/css' href='jquery.alerts.css' />
  374. <script type='text/javascript' src='alert.js'></script>
  375.         <script src="valid/js/languages/jquery.validationEngine-ru.js" type="text/javascript" charset="utf-8">
  376.         </script>
  377.         <link href="css/base.css" rel="stylesheet" />
  378.         <link href="css/jmodal.css" rel="stylesheet" />
  379.         <script type="text/javascript" src="js/jmodal.js"></script>
  380.         <script src="valid/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
  381.         </script>
  382.         <script>
  383.             jQuery(document).ready(function(){
  384.                 // binds form submission and fields to the validation engine
  385.                 jQuery("#form1").validationEngine();
  386.  
  387.                
  388.        
  389.             });
  390.         </script>
  391.    
  392.      <script language="javascript" type="text/javascript">
  393. function add_gr(){
  394. new_gr = prompt("Введите название группы пользователей","");
  395. if(new_gr!= ''){
  396.        
  397.         $.post("./users_sys.php",{"act":"add_gr","new_gr":new_gr},function(data){
  398.                 $("#name_gr").html(data);
  399.                 });
  400. }
  401. }
  402.  
  403.  
  404. </script>
  405.  
  406.        
  407. </head>
  408.  
  409. <body class="oneColFixCtrHdr">
  410. <script type="text/javascript" src="/menu.js"></script>
  411.    <div id="wrap">
  412.          <input type='hidden' value=1 id="flag">
  413.                 <a href="#" id="show-jm-first" class="jm-show">Показать обычное модальное окно</a>
  414.     </div>
  415.   <div id="jm-fader"></div>
  416.     <div id="jm-container">
  417.         <a href="#" class="jm-close"></a>
  418.         <div class="jm-header">Some title</div>
  419.         <div class="jm-content">Lorem ipsum!</div>
  420.     </div>
  421. <div id="container">
  422.   <div id="header"><span class="style5">{вход}</span>
  423.      <input type="submit" name="vhod" id="vhod" value="Вход" class="button-blue" onclick="location.href='members.php'"/>
  424.      <div id="menu">    </div>
  425.     <h1 align="center" class="style1">Пользователи системы</h1>
  426.     <p align="center" class="style1">&nbsp;</p>
  427.     <!-- end #header --></div>
  428.   <div id="mainContent">
  429.            <form id="form1" name="form1" method="post" action="./users_sys.php" class="formular">
  430.                         <input type="hidden" name="act" value="{action}"/>
  431.       <table width="100%" border="0">
  432.         <tr>
  433.           <td width="28%">Логин:</td>
  434.           <td width="72%">
  435.           *<input type="text" name="login" id="login" class="validate[required,custom[onlyLetterSp]]  text-input textinput"/></td>
  436.        
  437.         </tr>
  438.         <tr>
  439.           <td>Пароль:</td>
  440.           <td><label for="pas"></label>
  441.           *<input type="text" name="pas" id="pas" class="validate[required] text-input textinput"/>
  442.         <script type="text/javascript">
  443. function mtRand(min, max)
  444. {
  445.  var range = max - min + 1;
  446.  var n = Math.floor(Math.random() * range) + min;
  447.  return n;
  448. }
  449.  
  450.  
  451. function showPass()
  452. {
  453.  pas= prompt('Рекомендуемый пароль:', mkPass(mtRand(10, 14)));
  454.  document.forms["form1"].pas.value = pas;
  455. }
  456.  
  457. function mkPass(len)
  458. {
  459.  var len=len?len:14;
  460.  var pass = '';
  461.  var rnd = 0;
  462.  var c = '';
  463.  for (i = 0; i < len; i++) {
  464. rnd = mtRand(0, 2); // Латиница или цифры
  465. if (rnd == 0) {
  466. c = String.fromCharCode(mtRand(48, 57));
  467. }
  468. if (rnd == 1) {
  469. c = String.fromCharCode(mtRand(65, 90));
  470. }
  471. if (rnd == 2) {
  472. c = String.fromCharCode(mtRand(97, 122));
  473. }
  474. pass += c;
  475. }
  476. return pass;
  477. }
  478.  
  479. </script>
  480.  
  481. <a href="javascript: showPass();">Генерировать пароль</a>
  482.                
  483.          
  484.         </tr>
  485.         <tr>
  486.           <td>Выберите группу:</td>
  487.           <td><label for="name_gr"></label>
  488.                
  489.             <select name="name_gr" id="name_gr" class="textinput">
  490.               {name_options}
  491.           </select>   <input type="button" name="gr" id="gr" value="Добавить" onclick="add_gr();" class="submit" /></td>
  492.         </tr>
  493.  
  494.         <tr>
  495.           <td>Персона:</td>
  496.           <td>*<input name="autocomplete1" type="text" id="autocomplete1" class="validate[required] text-input textinput"/>
  497. <script type="text/javascript" src="jquery/jquery.js"></script>
  498. <script type="text/javascript" src="jquery/jquery.autocomplete.js"></script>
  499. <script type="text/javascript">
  500. $(document).ready(function() {
  501.         $('#autocomplete1').autocomplete('users_sys.php', {
  502.     delay:10,
  503.     minChars:1,
  504.     matchSubset:1,
  505.     autoFill:true,
  506.     extraParams: {forcli: 1},
  507.     maxItemsToShow:10
  508.     }
  509.   );
  510. });
  511. </script>
  512.           <input type="button" name="ewter" id="ewter" value="Добавить"onclick="location.href='persons.php'" class="submit"/></td>
  513.         </tr>
  514.       </table>
  515.       <p>
  516.       <input type="hidden" name="submitted" id="submitted" value="true" />
  517.                 <button id="button" type="submit" class="submit">Отправить</button>
  518.         <input type="reset" name="change" id="change" value="Сброс" class="submit" />
  519.       </p>
  520.       <label for="change"></label>
  521.       <label for="save"></label>
  522.  
  523. <br/>
  524.     </form>
  525.     <h1>&nbsp;</h1>
  526.     </div>
  527.   <div id="footer">
  528.     <!-- end #footer -->
  529.   </div>
  530. <!-- end #container --></div>
  531.  
  532. </body>
  533. </html>
  534.  
 
 Top
Иван14
Отправлено: 19 Июля, 2012 - 09:40:24
Post Id



Гость


Покинул форум
Сообщений всего: 111
Дата рег-ции: Авг. 2011  
Откуда: Владивосток


Помог: 0 раз(а)




tuareg пишет:
Откройте fierfox. Установите fierbug. запустите... . И смотрите там, что есть ошибки и т.д


хороший совет! присоединяюсь.. пока сами не научитесь находить ошибки, толку не будет..
 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 09:42:30
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




Иван14 пишет:
tuareg пишет:
Откройте fierfox. Установите fierbug. запустите... . И смотрите там, что есть ошибки и т.д


хороший совет! присоединяюсь.. пока сами не научитесь находить ошибки, толку не будет..

Стоит у меня и то и другое... Просто тут дело не в ошибке, а в правильном подключении. Везде модальные окна открываются по нажатии на кнопку или ссылку, а мне надо по условию.
 
 Top
tuareg
Отправлено: 19 Июля, 2012 - 09:57:48
Post Id


Участник


Покинул форум
Сообщений всего: 1234
Дата рег-ции: Июнь 2010  


Помог: 69 раз(а)




Вы что конкретно хотите? У вас загружается страница и Вы хотите по какому-то условию сразу открывалось модальное окно?
 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 10:21:46
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




tuareg пишет:
Вы что конкретно хотите? У вас загружается страница и Вы хотите по какому-то условию сразу открывалось модальное окно?

Да. Открылась страница, я заполнила форму, если есть совпадения по полю в базе, то появлялось окошко: Такая запись уже есть.
 
 Top
tuareg
Отправлено: 19 Июля, 2012 - 10:38:24
Post Id


Участник


Покинул форум
Сообщений всего: 1234
Дата рег-ции: Июнь 2010  


Помог: 69 раз(а)




Делайте ajax запрос и все. Тут сложного нет ничего.
 
 Top
quinlena
Отправлено: 19 Июля, 2012 - 10:39:51
Post Id


Частый гость


Покинул форум
Сообщений всего: 157
Дата рег-ции: Апр. 2012  
Откуда: Казахстан


Помог: 0 раз(а)




tuareg пишет:
Делайте ajax запрос и все. Тут сложного нет ничего.

Всячески избегаю ajax. Слишком сложно... А можно сделать чтобы обычный алерт был, но при этом не затемнялся фон сзади?
 
 Top
tuareg
Отправлено: 19 Июля, 2012 - 10:45:11
Post Id


Участник


Покинул форум
Сообщений всего: 1234
Дата рег-ции: Июнь 2010  


Помог: 69 раз(а)




quinlena пишет:
Всячески избегаю ajax. Слишком сложно...

Оригинальное решение. Не понял
Тогда делайте как делали (если ошибок нет). только + эмулируйте еще нажатие на что-то что может вызвать модальное окно.
 
 Top
Страниц (3): [1] 2 3 »
Сейчас эту тему просматривают: 0 (гостей: 0, зарегистрированных: 0)
« JavaScript & VBScript »


Все гости форума могут просматривать этот раздел.
Только зарегистрированные пользователи могут создавать новые темы в этом разделе.
Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
 



Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB