PHP.SU

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

Страниц (11): В начало « ... 3 4 5 6 7 8 [9] 10 11 »

> Найдено сообщений: 157
quinlena Отправлено: 19 Июля, 2012 - 09:32:30 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript

Ответов: 39
Просмотров: 10649
Вот так же вставить?
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.  
quinlena Отправлено: 19 Июля, 2012 - 09:17:13 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript

Ответов: 39
Просмотров: 10649
Иван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);
quinlena Отправлено: 19 Июля, 2012 - 09:09:16 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript

Ответов: 39
Просмотров: 10649
[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.. пробуйте.. и не извращайтесь никогда так над кавычками )

Исправила, все равно окошко не показывает. В чем еще может быть причина?
quinlena Отправлено: 19 Июля, 2012 - 07:40:46 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript

Ответов: 39
Просмотров: 10649
Всем добрый день! Подскажите, как сделать вызов модального окна по условию? Вызываю вот так:
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.                 }

Ничего не выходит(((( Помогите, пожалуйста!
quinlena Отправлено: 18 Июля, 2012 - 08:52:26 • Тема: Как сделать звуковое уведомление о новой записи? • Форум: Напишите за меня, пожалуйста

Ответов: 0
Просмотров: 46
Привет! Искала в гугле, как сделать звуковое уведомление о новой записи, так чтоб браузер мог быть свернутым. Ничего дельного не нашла. Пока сделано так:
PHP:
скопировать код в буфер обмена
  1.  
  2. $bag= mysql_fetch_array(mysql_query ("SELECT COUNT(*) as coun FROM  `segment_request` WHERE `id_person`='".$polzov."' AND `ud_req`='0' and `read`='0' "));
  3.      $coun=$bag['coun'];
  4.  
  5.   echo"<script type='text/javascript'>
  6.  
  7. var timerI = 120;
  8. function reset() {
  9.    timerI = timerI - 1;
  10.    if (timerI >= 0) $('#tim').text('(' + timerI + ' c.)');
  11.    if (timerI == 0) window.location.replace(window.location);
  12. }
  13. $(document).ready(function(){
  14.    setInterval('reset();', 1000);
  15. });
  16.  
  17. </script>" ;
  18. if ($coun>'0')
  19. {
  20.         echo "<script type='text/javascript'>$(document).ready(function(){var zap =jConfirm('Количество новых заявок: '+$coun,'Уведомление',function(r){if(!r=='0')
  21.         {location.href='et_request.php?id=".$polzov."';}
  22.          elseif (r=='0') {}
  23.         });});
  24.         </script>
  25.        
  26. <embed src='door_bell.mp3' hidden='true' height='1' width='1'></embed>
  27.         ";
  28. }
  29.  
quinlena Отправлено: 12 Мая, 2012 - 14:12:51 • Тема: Маска ввода Masked Input Plugin • Форум: Вопросы новичков

Ответов: 0
Просмотров: 119
Добрый день! Скачала Masked Input Plugin, подключила, все нормально высвечивается. Подскажите, как сделать, чтобы данные из него считывались в бд? Либо можно ли как-то изменить плагин, чтоб формат был YYYY-MM-DD?
quinlena Отправлено: 06 Мая, 2012 - 20:23:32 • Тема: Как сделать выборку по диапазону дат? • Форум: Напишите за меня, пожалуйста

Ответов: 0
Просмотров: 28
Добрый вечер! Нашла вот пример, там с помощью jquery идет выбор диапазона дат. Как сделать так, чтобы при выборе диапазона, нажатия кнопки шел вывод таблицы из этого диапазона.
statistic.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=windows-1251" />
  5. <link type="text/css" href="css/ui.datepicker.css" rel="stylesheet">
  6. <script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
  7. <script src="js/ui.datepicker.min.js" type="text/javascript"></script>
  8. <script src="js/jquery-ui-i18n.js" type="text/javascript"></script>
  9. <title>Untitled Document</title>
  10. <style type="text/css">
  11. <!--
  12. body
  13. .style4 {font-family: "Courier New", Courier, monospace}
  14. -->
  15. </style>
  16.  
  17. </head>
  18.  
  19. <body class="oneColFixCtrHdr">
  20.  
  21. <div id="container">
  22.   <div id="header">
  23.  
  24.     <h1 align="center" class="style4">Статистика</h1>
  25.   <!-- end #header --></div>
  26.   <div id="mainContent">
  27.   <script type="text/javascript">
  28. $(function(){
  29.   $.datepicker.setDefaults(
  30.    $.extend($.datepicker.regional["ru"])
  31.   );
  32.   $("#datepicker").datepicker({
  33.     rangeSelect: true,
  34.     minDate: "-1y",
  35.     maxDate: "+1y",
  36.     changeMonth: true,
  37.     changeYear: true,
  38.     dateFormat: "dd.mm.yy",
  39.     defaultDate: null
  40.   });
  41. });
  42. </script>
  43.  
  44.     <form id="form1" name="form1" method="post" action="">
  45.       <table width="100%" border="0">
  46.         <tr>
  47.           <td width="36%">Категория:</td>
  48.           <td width="64%"><select name="table" id="table">
  49.            {table_options}
  50.           </select>          </td>
  51.         </tr>
  52.         <tr>
  53.          
  54.           <td>Диапазон дат:</td>
  55.           <td><input id="datepicker" type="text" name="date12" size="23" maxlength="23" value=""></td>
  56.         </tr>
  57.       </table>
  58.       <p>&nbsp;      </p>
  59.       <p align="center">
  60.         <input type="submit" name="stat" id="stat" value="Показать" />
  61.       </p>
  62.     </form>
  63.     <h1>&nbsp;</h1>
  64.     </div>
  65.   <div id="footer">
  66.     <!-- end #footer -->
  67.   </div>
  68. <!-- end #container --></div>
  69.  
  70. </body>
  71. </html>

Подскажите, пожалуйста!
(Добавление)
Формат даты в БД - timestamp.
quinlena Отправлено: 05 Мая, 2012 - 12:58:09 • Тема: Помогите с автокомплитом и связными списками из бд за деньги • Форум: FreeLance

Ответов: 0
Просмотров: 492
Помогите, пожалуйста! Пишете в личку lena__frolova@mail.ru
quinlena Отправлено: 05 Мая, 2012 - 12:10:04 • Тема: Помогите с автокомплитом, пожалуйста!!! • Форум: Вопросы новичков

Ответов: 0
Просмотров: 70
Как этот файл правильно вставить в следующий.
PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. /* Подключаетесь к базе и
  3. /* выбираете из нужной таблицы
  4. /* нужный столбец */
  5.  // Выводите как простой текст
  6.  
  7. header("Content-type: text/html; charset=windows-1251");
  8. $sql = mysql_connect("localhost","root","");
  9. mysql_select_db("vol_base");
  10. $pz1 = $_GET['q'];
  11. $pz = iconv("UTF-8", "WINDOWS-1251", $pz1);
  12. $res = mysql_query("SELECT * FROM dir_service WHERE name_service LIKE '$pz%'");
  13. while ($street = mysql_fetch_array($res))
  14. {      
  15. echo $street['name_service']."\r\n";
  16. }
  17.  
  18. ?>



PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. include_once("./common.php");
  3. $link = _mysql_connect("vol_base");
  4. $fname = './tpl/request.html';
  5. $fcontent = file_get_contents($fname);
  6. if(isset($_POST['act']) == "insert"){
  7.                 $datetime_request = addslashes($_POST['datetime_request']);
  8. $req=intval($_POST['name_type_request']);
  9. $requ=intval($_POST['name_type_1request']);
  10. $n_cl=intval($_POST['name_cl']);
  11. $serv=intval($_POST['autocomplete']);
  12.  
  13.                 $sql = sprintf("INSERT INTO `segment_request` (`datetime_request`,`id_type_request`,`id_type_1request`,`id_client`,`id_service`)
  14.                         VALUES ('%s','%d','%d','%d','%d')",
  15.                         $datetime_request,
  16.                         $req,
  17.                         $requ,
  18.                         $n_cl,
  19.                         $serv
  20.                         );
  21. //echo $sql;die();
  22.         if(!mysql_query($sql,$link)){
  23.                 echo mysql_error();
  24.         }
  25. }elseif(isset($_POST['act']) == "update"){
  26.        
  27.         $sql = "UPDATE `segment_request` SET `datetime_request`='".$datetime_request."',``=''";
  28. }else{
  29.         $req =  mysql_query("SELECT `id_type_request`,`name_type_request` FROM `type_request`",$link);
  30.         $req_options = '';
  31.         while($row = mysql_fetch_array($req)){
  32.         $req_options .= "<option value='".$row['id_type_request']."'>".$row['name_type_request']."</option>";
  33.         }
  34.         $content = replace_vars("{type_options}",$req_options);
  35.        
  36.         $requ =  mysql_query("SELECT `id_type_1request`,`name_type_request` FROM `type_1request`",$link);
  37.         $type_options = '';
  38.         while($row = mysql_fetch_array($requ)){
  39.         $type_options .= "<option value='".$row['id_type_1request']."'>".$row['name_type_request']."</option>";
  40.         }
  41.         $content = replace_vars("{type1_options}",$type_options);
  42.        
  43.         $n_cl =  mysql_query("SELECT `id_client`,`name_client` FROM `clients`",$link);
  44.         $cli_options = '';
  45.         while($row = mysql_fetch_array($n_cl)){
  46.         $cli_options .= "<option value='".$row['id_client']."'>".$row['name_client']."</option>";
  47.         }
  48.         $content = replace_vars("{cli_options}",$cli_options);
  49.         $rel = mysql_query("SHOW TABLE STATUS FROM `vol_base` LIKE 'segment_request'",$link);
  50.         $row = mysql_fetch_assoc($rel);
  51.         $id_request2 = $row['Auto_increment'];
  52.         replace_vars("{id_req}",$id_request2);
  53.        
  54.         $content = replace_vars("{action}","insert");      
  55. }
  56. echo $fcontent;
  57. ?>



И сделать так, чтобы в таблицу заносилось id того, что набрано в автокомплите?
quinlena Отправлено: 28 Апреля, 2012 - 19:25:30 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Вообще данный код работает исправно из файла dat. Я просто узнаю про базу mysql...
(Добавление)
Мне бы простое автозаполнение из базы mysql, даже без зависимого поля...
quinlena Отправлено: 28 Апреля, 2012 - 19:14:29 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Если вместо этой строки

Осуществить подключение к базе, то будет из базы брать значения?
quinlena Отправлено: 28 Апреля, 2012 - 19:09:23 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Panoptik пишет:
а сервер вообще вам возвращает чтото.
вы хотите сделать всё и сразу. тут нужно поэтапно определять работоспособность отдельных частей приложения

В примере дан вот такой код php
PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. header('Content-Type: text/html; charset=utf-8');
  3. if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
  4.   if($_GET['q']){
  5.     $base = @file("autocomplete.dat");
  6.     for($i=0;$i<count($base);$i++){
  7.           $row_base = explode(":", $base[$i]);
  8.           $res = mb_strpos(mb_strtolower($row_base[1],"UTF-8"), mb_strtolower($_GET['q'],"UTF-8"));
  9.           if($res!==false&&$res==0) {
  10.             $row_base[3] = trim($row_base[3]);
  11.                 print $row_base[1]."|".$row_base[3]."|".$row_base[2]."|".$row_base[0]."\n";
  12.           }
  13.     }
  14.   }
  15. }
  16. ?>

Разве не нужно html подключать?
(Добавление)
Panoptik пишет:
а сервер вообще вам возвращает чтото.
вы хотите сделать всё и сразу. тут нужно поэтапно определять работоспособность отдельных частей приложения

Все, дошло)) нужно html запускать, а не пхп... А можно код перестроить на подключение к базе mysql?
quinlena Отправлено: 28 Апреля, 2012 - 18:48:01 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Panoptik пишет:

Я кстати пробовала по этому примеру и почему-то не вышло. Там версия 1.2, а сейчас на сайте 1.7. Возможно это повлияло...
(Добавление)
Panoptik пишет:

Щас попробую еще раз сделать. Отпишусь.
(Добавление)
Panoptik пишет:

Вообще даже вывод не происходит(((
quinlena Отправлено: 28 Апреля, 2012 - 18:33:55 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Panoptik пишет:
у вас в коде автокомплита не указан параметр аджакс загрузки. посмотрите в документации

Делала вот по этому примеру...
(Добавление)
Panoptik пишет:
у вас в коде автокомплита не указан параметр аджакс загрузки. посмотрите в документации

Скачала пример, там нет аякса... Что делать?
quinlena Отправлено: 28 Апреля, 2012 - 17:55:52 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков

Ответов: 11
Просмотров: 468
Вот код backend.php
PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. /* Подключаетесь к базе и
  3. /* выбираете из нужной таблицы
  4. /* нужный столбец */
  5.  // Выводите как простой текст
  6.  
  7. header("Content-type: text/html; charset=windows-1251");
  8. $sql = mysql_connect("localhost","root","");
  9. mysql_select_db("vol_base");
  10. $pz1 = $_POST['value'];
  11. $pz = iconv("UTF-8", "WINDOWS-1251", $pz1);
  12. $res = mysql_query("SELECT * FROM gender WHERE name_gen LIKE '$pz%'");
  13. while ($street = mysql_fetch_array($res))
  14. {      
  15. echo ''.$street['name_gen'].'';
  16. }
  17.  
  18. ?>


И код 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" xml:lang="ru" lang="ru">
  3. <head>
  4. <title>Autocomplete с помощью jQuery</title>
  5. <meta http-equiv="Content-Language" content="ru"/>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  7. <style type="text/css">
  8. * {
  9.     margin:0;
  10.     padding:0;
  11. }
  12. html, body {
  13.     background-color:#FFF;
  14.     font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
  15.     font-size: 8pt;
  16. }
  17. .ac_results {
  18.         padding: 0px;
  19.         border: 1px solid WindowFrame;
  20.         background-color: Window;
  21.         overflow: hidden;
  22. }
  23.  
  24. .ac_results ul {
  25.         width: 100%;
  26.         list-style-position: outside;
  27.         list-style: none;
  28.         padding: 0;
  29.         margin: 0;
  30. }
  31.  
  32. .ac_results iframe {
  33.         display:none;/*sorry for IE5*/
  34.         display/**/:block;/*sorry for IE5*/
  35.         position:absolute;
  36.         top:0;
  37.         left:0;
  38.         z-index:-1;
  39.         filter:mask();
  40.         width:3000px;
  41.         height:3000px;
  42. }
  43.  
  44. .ac_results li {
  45.         position:relative;
  46.     margin: 0px;
  47.         padding: 2px 5px;
  48.         cursor: pointer;
  49.         display: block;
  50.         width: 100%;
  51.         font: menu;
  52.         font-size: 12px;
  53.         overflow: hidden;
  54. }
  55.  
  56. .ac_loading {
  57.         background : Window url('autocomplete_indicator.gif') right center no-repeat;
  58. }
  59.  
  60. .ac_over {
  61.         background-color: Highlight;
  62.         color: HighlightText;
  63. }
  64. #example {
  65.   position:absolute;
  66.   top:10px;
  67.   left:10px;
  68.   width:150px;
  69.   font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
  70.   font-size: 10pt;
  71. }
  72. #example2 {
  73.   position:absolute;
  74.   top:10px;
  75.   left:170px;
  76.   width:240px;
  77.   font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
  78.   font-size: 10pt;
  79. }
  80. .qnt {
  81.   position:absolute;
  82.   top:2px;
  83.   right:10px;
  84.   font-size:0.8em;
  85.   color:#26A908;
  86. }
  87. </style>
  88. </head>
  89. <body>
  90.  
  91. <input name="autocomlete" type="text" id="autocomplete" />
  92.  
  93. <script type="text/javascript" src="jquery/jquery.js"></script>
  94. <script type="text/javascript" src="jquery/jquery.autocomplete.js"></script>
  95. <script type="text/javascript">
  96. $(document).ready(function() {
  97.         $('#autocomplete').autocomplete('backend1.php', {
  98.     delay:10,
  99.     minChars:1,
  100.     matchSubset:1,
  101.     autoFill:true,
  102.     maxItemsToShow:10
  103.     }
  104.   );
  105. });
  106. </script>
  107. </body>
  108. </html>

Помогите, пожалуйста, как сделать, чтоб автозаполнение было...

Страниц (11): В начало « ... 3 4 5 6 7 8 [9] 10 11 »
Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB