PHP . SU
Программирование на PHP, MySQL и другие веб-технологии
Страниц (11): В начало « ... 3 4 5 6 7 8 [9] 10 11 »
Найдено сообщений: 157
quinlena
Отправлено: 19 Июля, 2012 - 09:32:30 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript
Ответов: 39 Просмотров: 10649
Вот так же вставить?
PHP:
скопировать код в буфер обмена
< script type= "text/javascript" >
$. fn. jmodal( {
title: 'Information' ,
content: 'Hi,you displayed me?' ,
buttonText: 'Yes,It\'s me' ,
okEvent: function ( e) {
alert( 'jmodal\'ll be closed after u click me:-)' ) ;
}
} ) ;
</script>
Так не срабатывает((
Вот файл html:
CODE (
html ):
скопировать код в буфер обмена
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml" >
<head >
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
<title > Untitled Document</ title >
<style type = "text/css" >
<!--
body {
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
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 */
color: #000000;
background-color: #666666;
background-image: url(Widescreen__004624_.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 90%;
}
#jm-fader {
background: #888;
display: none;
position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100;
}
#jm-container {
background-color: #000;
padding: 10px;
width: 400px;
font-family: Ubuntu, Tahoma, Arial;
display: none; overflow: hidden;
position: absolute; top: 0; left: -1000px; z-index: 150;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 3px;
-webkit-box-shadow: 0px 0px 15px #333;
-moz-box-shadow: 0px 0px 15px #333;
-o-box-shadow: 0px 0px 15px #333;
box-shadow: 0px 0px 15px #333;
}
div.jm-header {
font-size: 15px;
color: #fff;
margin: 0px 5px 10px;
}
div.jm-content {
background-color: #fff;
font-size: 13px;
color: #454545;
padding: 10px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
}
a.jm-close {
background: url('../images/jm-close.png') center no-repeat;
width: 15px; height: 15px;
display: block; float: right;
margin: 2px 3px 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
-webkit-opacity: .2;
-moz-opacity: .2;
-o-opacity: .2;
opacity: .2;
}
#jm-container:hover a.jm-close {
-webkit-opacity: 1;
-moz-opacity: 1;
-o-opacity: 1;
opacity: 1;
}
.oneColFixCtrHdr #container {
width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtrHdr #header {
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. */
background-color: #006699;
}
.oneColFixCtrHdr #header h1 {
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 */
padding: 1px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.oneColFixCtrHdr #mainContent {
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
background: #FFFFFF;
}
.oneColFixCtrHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.oneColFixCtrHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.ac_results {
padding: 0px;
border: 1px solid WindowFrame;
background-color: Window;
overflow: hidden;
}
.button {
margin: 10px;
text-decoration: none;
font: bold 25px 'Trebuchet MS',Arial, Helvetica;
display: inline-block;
text-align: center;
color: #fff;
border: 1px solid #9c9c9c;
border: 1px solid rgba(0, 0, 0, 0.3);
text-shadow: 0 1px 0 rgba(0,0,0,0.4);
box-shadow: 0 0 1px rgba(0,0,0,0.4);
-moz-box-shadow: 0 0 1px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 1px rgba(0,0,0,0.4);
}
.button, .button span {
-moz-border-radius: 6px;
border-radius: 6px;
}
.button span {
border-top: 1px solid #fff;
border-top: 1px solid rgba(100, 100, 100, 0.5);
display: block;
padding: 12px 50px;
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(0, 0, 0, 0.05)), color-stop(.25, transparent), to(transparent)),
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05))),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, rgba(0, 0, 0, 0.05)));
background-image: -moz-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
-moz-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%, transparent),
-moz-linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
-moz-linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
-moz-background-size: 3px 3px;
-webkit-background-size: 3px 3px;
}
.button:hover {
box-shadow: 0 0 1px rgba(0,0,0,0.4);
-moz-box-shadow: 0 0 1px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 1px rgba(0,0,0,0.4);
}
.button:active {
position: relative;
top: 1px;
}
/* Голубая кнопка */
.button-blue {
background: #4477a1;
background: -webkit-gradient(linear, left top, left bottom, from(#81a8cb), to(#4477a1) );
background: -moz-linear-gradient(-90deg, #81a8cb, #4477a1);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#81a8cb', endColorstr='#4477a1');
}
.button-blue:hover {
background: #81a8cb;
background: -webkit-gradient(linear, left top, left bottom, from(#4477a1), to(#81a8cb) );
background: -moz-linear-gradient(-90deg, #4477a1, #81a8cb);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4477a1', endColorstr='#81a8cb');
}
.button-blue:active {
background: #4477a1;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results iframe {
display:none;/*sorry for IE5*/
display/**/:block;/*sorry for IE5*/
position:absolute;
top:0;
left:0;
z-index:-1;
filter:mask();
width:3000px;
height:3000px;
}
.ac_results li {
position:relative;
margin: 0px;
padding: 2px 5px;
cursor: pointer;
display: block;
width: 100%;
font: menu;
font-size: 12px;
overflow: hidden;
}
.submit {
width: 85px;
height: 27px;
padding: 0 0 2px;
font: 16px "Trebuchet MS", Tahoma, Arial, sans-serif;
outline: none;
position: relative;
cursor: pointer;
border-radius: 3px;
color: #515F6A;
text-shadow: 1px 1px #C4D0DA;
border: 1px solid #7C8A93;
border-top: 1px solid #A1AEB7;
border-bottom: 1px solid #5D6B75;
box-shadow:
inset 0 1px #D8E0E6,
inset 1px 0 #B7C6D1,
inset -1px 0 #B7C6D1,
inset 0 -1px #A1B5C4,
0 2px #62727E,
0 3px #5D6B75,
0 4px 2px rgba(0,0,0,0.4)
;
background: -moz-linear-gradient(top, #becbd6 0%, #8da5b7 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#becbd6), color-stop(100%,#8da5b7)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #becbd6 0%,#8da5b7 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #becbd6 0%,#8da5b7 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #becbd6 0%,#8da5b7 100%); /* IE10+ */
background: linear-gradient(top, #becbd6 0%,#8da5b7 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#becbd6', endColorstr='#8da5b7',GradientType=0 ); /* IE6-9 */
background-color: #A5B8C6;
}
.submit::-moz-focus-inner{border:0}
.submit:hover {
border-top: 1px solid #96A2AB;
box-shadow:
inset 0 1px #C0CED7,
inset 1px 0 #B7C6D1,
inset -1px 0 #B7C6D1,
inset 0 -1px #B9C8D3,
0 2px #62727E,
0 3px #5D6B75,
0 4px 2px rgba(0,0,0,0.4)
;
background: -moz-linear-gradient(top, #97adbd 0%, #a8bac8 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#97adbd), color-stop(100%,#a8bac8)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #97adbd 0%,#a8bac8 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #97adbd 0%,#a8bac8 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #97adbd 0%,#a8bac8 100%); /* IE10+ */
background: linear-gradient(top, #97adbd 0%,#a8bac8 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#97adbd', endColorstr='#a8bac8',GradientType=0 ); /* IE6-9 */
background-color: #A5B8C6;
}
.submit:active {
top: 3px;
border: 1px solid #778998;
border-top: 1px solid #606F7A;
border-bottom: 1px solid #8296A6;
background: #92A9BA;
box-shadow: inset 0 1px 2px #5F7281;
}
.ac_loading {
background : Window url('autocomplete_indicator.gif') right center no-repeat;
}
.ac_over {
background-color: Highlight;
color: HighlightText;
}
#example {
position:absolute;
top:10px;
left:10px;
width:150px;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
#example2 {
position:absolute;
top:10px;
left:170px;
width:240px;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
.qnt {
position:absolute;
top:2px;
right:10px;
font-size:0.8em;
color:#26A908;
}
.style1 {
color: #000033;
font-family: "Courier New", Courier, monospace;
}
.styled-select select {
background: white;
width: auto;
padding: 5px;
font-size: 12px;
border: 1px solid #ccc;
height: 30px;
}
.styled-select {
width: auto;
height: 30px;
overflow: hidden;
background: url(re.png) no-repeat right;
}
tr{list-style:none;padding: 10px 0 10px 100px;}
tr td{margin-bottom: 21px;position: relative;}
.textinput{
border-radius: 3px;
border: 1px solid #AAA;
padding: 3px 5px;
color: #888;
width: 140px;
box-shadow: 0px 0px 5px #CCC;
transition: all 300ms ease-in;
}
.textinput:hover
{
border-color: #66cccc;
box-shadow: 0px 0px 6px #99ccff;
color: #666;
}
.textinput:focus
{
border-color: #6699cc;
box-shadow: 0px 0px 6px #66ccff;
color: #333;
outline: 0;
}
.style5{
color:white;
font-family: "Courier New", Courier, monospace;
}
textarea.textinput{width: 200px;}
input.checking{margin-top:20px;}
label{position:absolute;left:0;top:0;}
button{margin-left:100px;cursor:pointer;outline:none;}
.textmessage .error{width:100px;}
.error{
color:red;
padding-left: 10px;
position: absolute;
top: 0;}
.thanks{text-align:center;padding-top:10px;color:green;}
-->
</ style >
<script type = "text/javascript" src = "/coolmenus.js" ></ script >
<link href = "/style.menu.css" rel = "stylesheet" type = "text/css" / >
<link rel = "stylesheet" href = "valid/css/validationEngine.jquery.css" type = "text/css" / >
<script src = "valid/js/jquery-1.6.min.js" type = "text/javascript" >
</ script >
<link rel = 'stylesheet' type = 'text/css' href = 'jquery.alerts.css' / >
<script type = 'text/javascript' src = 'alert.js' ></ script >
<script src = "valid/js/languages/jquery.validationEngine-ru.js" type = "text/javascript" charset = "utf-8" >
</ script >
<link href = "css/base.css" rel = "stylesheet" / >
<link href = "css/jmodal.css" rel = "stylesheet" / >
<script type = "text/javascript" src = "js/jmodal.js" ></ script >
<script src = "valid/js/jquery.validationEngine.js" type = "text/javascript" charset = "utf-8" >
</ script >
<script >
jQuery(document).ready(function(){
// binds form submission and fields to the validation engine
jQuery("#form1").validationEngine();
});
</ script >
<script language = "javascript" type = "text/javascript" >
function add_gr(){
new_gr = prompt("Введите название группы пользователей","");
if(new_gr!= ''){
$.post("./users_sys.php",{"act":"add_gr","new_gr":new_gr},function(data){
$("#name_gr").html(data);
});
}
}
</ script >
</ head >
<body class = "oneColFixCtrHdr" >
<script type = "text/javascript" src = "/menu.js" ></ script >
<div id = "wrap" >
<input type = 'hidden' value = 1 id = "flag" >
<a href = "#" id = "show-jm-first" class = "jm-show" > Показать обычное модальное окно</ a >
</ div >
<div id = "jm-fader" ></ div >
<div id = "jm-container" >
<a href = "#" class = "jm-close" ></ a >
<div class = "jm-header" > Some title</ div >
<div class = "jm-content" > Lorem ipsum!</ div >
</ div >
<div id = "container" >
<div id = "header" ><span class = "style5" > {вход}</ span >
<input type = "submit" name = "vhod" id = "vhod" value = "Вход" class = "button-blue" onclick = "location.href='members.php'" / >
<div id = "menu" > </ div >
<h1 align = "center" class = "style1" > Пользователи системы</ h1 >
<p align = "center" class = "style1" > </ p >
<!-- end #header --> </ div >
<div id = "mainContent" >
<form id = "form1" name = "form1" method = "post" action = "./users_sys.php" class = "formular" >
<input type = "hidden" name = "act" value = "{action}" / >
<table width = "100%" border = "0" >
<tr >
<td width = "28%" > Логин:</ td >
<td width = "72%" >
*<input type = "text" name = "login" id = "login" class = "validate[required,custom[onlyLetterSp]] text-input textinput" / ></ td >
</ tr >
<tr >
<td > Пароль:</ td >
<td ><label for = "pas" ></ label >
*<input type = "text" name = "pas" id = "pas" class = "validate[required] text-input textinput" / >
<script type = "text/javascript" >
function mtRand(min, max)
{
var range = max - min + 1;
var n = Math.floor(Math.random() * range) + min;
return n;
}
function showPass()
{
pas= prompt('Рекомендуемый пароль:', mkPass(mtRand(10, 14)));
document.forms["form1"].pas.value = pas;
}
function mkPass(len)
{
var len=len?len:14;
var pass = '';
var rnd = 0;
var c = '';
for (i = 0; i < len; i++) {
rnd = mtRand( 0, 2) ; // Латиница или цифры
if ( rnd == 0) {
c = String.fromCharCode( mtRand( 48, 57) ) ;
}
if ( rnd == 1) {
c = String.fromCharCode( mtRand( 65, 90) ) ;
}
if ( rnd == 2) {
c = String.fromCharCode( mtRand( 97, 122) ) ;
}
pass += c;
}
return pass;
}
</ script >
<a href = "javascript: showPass();" > Генерировать пароль</ a >
</ tr >
<tr >
<td > Выберите группу:</ td >
<td ><label for = "name_gr" ></ label >
<select name = "name_gr" id = "name_gr" class = "textinput" >
{name_options}
</ select > <input type = "button" name = "gr" id = "gr" value = "Добавить" onclick = "add_gr();" class = "submit" / ></ td >
</ tr >
<tr >
<td > Персона:</ td >
<td > *<input name = "autocomplete1" type = "text" id = "autocomplete1" class = "validate[required] text-input textinput" / >
<script type = "text/javascript" src = "jquery/jquery.js" ></ script >
<script type = "text/javascript" src = "jquery/jquery.autocomplete.js" ></ script >
<script type = "text/javascript" >
$(document).ready(function() {
$('#autocomplete1').autocomplete('users_sys.php', {
delay:10,
minChars:1,
matchSubset:1,
autoFill:true,
extraParams: {forcli: 1},
maxItemsToShow:10
}
);
});
</ script >
<input type = "button" name = "ewter" id = "ewter" value = "Добавить" onclick = "location.href='persons.php'" class = "submit" / ></ td >
</ tr >
</ table >
<p >
<input type = "hidden" name = "submitted" id = "submitted" value = "true" / >
<button id = "button" type = "submit" class = "submit" > Отправить</ button >
<input type = "reset" name = "change" id = "change" value = "Сброс" class = "submit" / >
</ p >
<label for = "change" ></ label >
<label for = "save" ></ label >
<br / >
</ form >
<h1 > </ h1 >
</ div >
<div id = "footer" >
<!-- end #footer -->
</ div >
<!-- end #container --> </ div >
</ body >
</ html >
quinlena
Отправлено: 19 Июля, 2012 - 09:17:13 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript
Ответов: 39 Просмотров: 10649
У меня не jqModal, а просто jModal.
Вот весь код файла пхп
PHP:
скопировать код в буфер обмена
<?PHP
if ( isset ( $_GET [ 'forcli' ] ) ) { header ( "Content-type: text/html; charset=windows-1251" ) ; $pz1 = $_GET [ 'q' ] ;
$pz = iconv ( "UTF-8" , "WINDOWS-1251" , $pz1 ) ; $client = mysql_query ( "SELECT * FROM persons WHERE ud_per='0' and last_name LIKE '$pz %'" ) ; {
echo urldecode ( $st [ 'last_name' ] . ' ' . $st [ 'first_name' ] ) . "\r \n " ; }
}
else
{
header ( "Content-type: text/html; charset=utf-8" ) ; include_once ( "./common.php" ) ;
if ( isset ( $_SESSION [ 'login' ] ) ) { $fname = './tpl/users_sysexit.html' ;
$link = _mysql_connect( "vol_base" ) ;
$id = ( int) $_GET [ 'id' ] ;
$id = $_GET [ 'id' ] ;
$cl_r = mysql_query ( "SELECT `last_name`,`first_name`,`id_person` FROM `persons` WHERE `id_person`='" . $id . "'" , $link ) ; replace_vars( "{person}" , $cl_r [ 'last_name' ] . ' ' . $cl_r [ 'first_name' ] ) ;
if ( isset ( $_POST [ 'act' ] ) == "insert" ) { $us = mysql_query ( "SELECT `id_user`, `login` FROM `users_sys` WHERE `login`='" . $_SESSION [ "login" ] . "'" ) ; $user = $us [ 'id_user' ] ;
$gr = intval ( $_POST [ 'name_gr' ] ) ; $last = $per [ 0] ;
$query = "SELECT id_person FROM persons WHERE last_name = '" . $per [ 0 ] . "' and first_name = '" . $per [ 1 ] . "'" ;
else {
$per = $client [ 'id_person' ] ; }
$coun = $dubl [ 'coun' ] ;
if ( $coun == '0' ) {
$sql = sprintf ( "INSERT INTO `users_sys` (`login`,`pas`,`id_group`,`id_person`,`id_user_rec_update`,`last_name`) VALUES ('%s ','%s ','%d ','%d ','%d ','%s ')" ,
$login ,
$pas ,
$gr ,
$per ,
$user ,
$last
) ;
//echo $sql;die();
} }
else { ?>
<link href="css/base.css" rel="stylesheet" />
<link href="css/jmodal.css" rel="stylesheet" />
<script type="text/javascript" src="js/jmodal.js"></script>
<script type="text/javascript">
$.jModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
</script>
<?PHP }
}
elseif ( isset ( $_POST [ 'act' ] ) == "update" ) {
$sql = "UPDATE `users_sys` SET `login`='" . $login . "',`pas`='" . $pas . "',`id_user_rec_update`='" . $user . "'``=''" ;
} else {
$fm_own = mysql_query ( "SELECT `id_group`,`name_gr` FROM `users_gr` WHERE `ud_gr`='0'" , $link ) ; $own_options = '' ;
$own_options .= "<option value='" . $row [ 'id_group' ] . "'>" . $row [ 'name_gr' ] . "</option>" ;
}
$content = replace_vars( "{name_options} " , $own_options ) ;
replace_vars( "{выход}" , $_SESSION [ 'login' ] ) ;
$content = replace_vars( "{action}" , "insert" ) ;
}
if ( isset ( $_POST [ 'act' ] ) && $_POST [ 'act' ] == "add_gr" ) { $sql = "INSERT INTO `users_gr` (`name_gr`)
VALUES('" . $name_gr . "')" ;
`users_gr`" , $link ) ;
$own_options = '' ;
$own_options .= "<option
value='" . $row [ 'id_group' ] . "'>" . $row [ 'name_gr' ] . "</option>" ;
}
echo $own_options ;
}
}
else {
echo $fcontent ;
}
}
}
if ( ! isset ( $_SESSION [ 'login' ] ) ) { header ( "Location: login.php" ) ; }
?>
(Добавление)
Вот такой файл jmodal
CODE (
javascript ):
скопировать код в буфер обмена
/*
* jModal
*
* author: Jurii Tarahonich aka Sofcase
* author page: http://sofcase.net/
* function options: width, open, close
*/
( function ( $) {
$.jModal = function ( header, content, options) {
options = $.extend ( {
width: '400px'
} , options) ;
var fader = $( '#jm-fader' ) ;
var container = $( '#jm-container' ) .css ( 'width' , options.width ) ;
var headerContainer = $( '#jm-container > .jm-header' ) ;
var contentContainer = $( '#jm-container > .jm-content' ) ;
var closeButton = $( '#jm-container > .jm-close' ) ;
// проверяем оверлей и показываем его
if ( fader.length ) {
fader.css ( {
opacity: .35,
height: $( document) .height ( )
} ) .show ( ) ;
} else {
if ( console && console.error ) {
console.error ( '[jModal] #jm-fader контейнер не найден.' ) ;
}
return false ;
}
// проверяем все ли части модального окна есть
if ( ! container.length && ! headerContainer.length && ! contentContainer.length && ! closeButton.length ) {
if ( console && console.log ) {
console.error ( '[jModal] Нехватает некоторых контейнеров модального окна.' ) ;
}
return false ;
}
// настраиваем модальное окно
headerContainer.text ( header) ;
contentContainer.html ( content) ;
// центрируем и показываем модальное окно
container.show ( ) .css ( {
top: ( parseInt( $( window) .height ( ) ) / 2) - (parseInt(container.height()) / 2 )
} ) .animate ( { left: ( parseInt( $( document) .width ( ) ) / 2) - (parseInt(options.width) / 2) } , 350, function ( ) {
// если есть коллбек на открытие, выполняем его
if ( typeof options.open != 'undefined' ) {
options.open .call ( container) ;
}
} ) ;
// вешаем закрытие окна на кнопку закрыть
closeButton.one ( 'click' , function ( ) {
container.animate ( { left: '-1000px' } , 350, function ( ) {
this .style .display = 'none' ;
fader.hide ( ) ;
if ( typeof options.close != 'undefined' ) {
options.close .call ( container) ;
}
} ) ;
} ) ;
// и клавишу Escape
$( document) .one ( 'keydown' , function ( e) {
if ( e.keyCode == 27 ) {
container.animate ( { left: '-1000px' } , 350, function ( ) {
this .style .display = 'none' ;
fader.hide ( ) ;
if ( typeof options.close != 'undefined' ) {
options.close .call ( container) ;
}
} ) ;
}
} ) ;
// если пользователь скроллит, тогда перемещаем окно
$( window) .scroll ( function ( ) {
container.stop ( true , false ) .animate ( { top: window.scrollY + ( parseInt( $( window) .height ( ) ) / 2) - (parseInt(container.height()) / 2) } , 500) ;
} ) ;
return true ;
}
} ) ( jQuery) ;
quinlena
Отправлено: 19 Июля, 2012 - 09:09:16 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript
Ответов: 39 Просмотров: 10649
[quote=Иван14][/quote]
Все равно не работает((
(Добавление)
CODE (
javascript ):
скопировать код в буфер обмена
<script type = "text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></ script>
<script type = "text/javascript" src= "js/jmodal.js" ></ script>
<script type = "text/javascript" >
$.jqModal ( 'Обычное сообщение' , 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.' ) ;
</script>
ну и у вас ошибка была не $.jModal а $.jqModal.. пробуйте.. и не извращайтесь никогда так над кавычками )
Исправила, все равно окошко не показывает. В чем еще может быть причина?
quinlena
Отправлено: 19 Июля, 2012 - 07:40:46 • Тема: Вызов окна по условию • Форум: JavaScript & VBScript
Ответов: 39 Просмотров: 10649
Всем добрый день! Подскажите, как сделать вызов модального окна по условию? Вызываю вот так:
PHP:
скопировать код в буфер обмена
else { echo "
<link href=\" css/base.css\" rel=\" stylesheet\" />
<link href=\" css/jmodal.css\" rel=\" stylesheet\" />
<script type=\" text/javascript\" src=\" http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\" ></script>
<script type=\" text/javascript\" src=\" js/jmodal.js\" ></script>
<script type=\" text/javascript\" >
$.jModal('Обычное сообщение', 'Это просто красивое модальное окошко, ничего больше. Используется для уведомления пользователя о каких либо действиях.');
</script>
" ; }
}
Ничего не выходит(((( Помогите, пожалуйста!
quinlena
Отправлено: 18 Июля, 2012 - 08:52:26 • Тема: Как сделать звуковое уведомление о новой записи? • Форум: Напишите за меня, пожалуйста
Ответов: 0 Просмотров: 46
Привет! Искала в гугле, как сделать звуковое уведомление о новой записи, так чтоб браузер мог быть свернутым. Ничего дельного не нашла. Пока сделано так:
PHP:
скопировать код в буфер обмена
$bag = mysql_fetch_array ( mysql_query ( "SELECT COUNT(*) as coun FROM `segment_request` WHERE `id_person`='" . $polzov . "' AND `ud_req`='0' and `read`='0' " ) ) ; $coun = $bag [ 'coun' ] ;
echo "<script type='text/javascript'>
var timerI = 120;
function reset() {
timerI = timerI - 1;
if (timerI >= 0) $('#tim').text('(' + timerI + ' c.)');
if (timerI == 0) window.location.replace(window.location);
}
$(document).ready(function(){
setInterval('reset();', 1000);
});
</script>" ;
if ( $coun > '0' )
{
echo "<script type='text/javascript'>$(document).ready(function(){var zap =jConfirm('Количество новых заявок: '+$coun ,'Уведомление',function(r){if(!r=='0')
{location.href='et_request.php?id=" . $polzov . "';}
elseif (r=='0') {}
});});
</script>
<embed src='door_bell.mp3' hidden='true' height='1' width='1'></embed>
" ;
}
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 ):
скопировать код в буфер обмена
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml" >
<head >
<meta http-equiv = "Content-Type" content = "text/html; charset=windows-1251" / >
<link type = "text/css" href = "css/ui.datepicker.css" rel = "stylesheet" >
<script src = "js/jquery-1.6.2.min.js" type = "text/javascript" ></ script >
<script src = "js/ui.datepicker.min.js" type = "text/javascript" ></ script >
<script src = "js/jquery-ui-i18n.js" type = "text/javascript" ></ script >
<title > Untitled Document</ title >
<style type = "text/css" >
<!--
body
.style4 {font-family: "Courier New", Courier, monospace}
-->
</ style >
</ head >
<body class = "oneColFixCtrHdr" >
<div id = "container" >
<div id = "header" >
<h1 align = "center" class = "style4" > Статистика</ h1 >
<!-- end #header --> </ div >
<div id = "mainContent" >
<script type = "text/javascript" >
$(function(){
$.datepicker.setDefaults(
$.extend($.datepicker.regional["ru"])
);
$("#datepicker").datepicker({
rangeSelect: true,
minDate: "-1y",
maxDate: "+1y",
changeMonth: true,
changeYear: true,
dateFormat: "dd.mm.yy",
defaultDate: null
});
});
</ script >
<form id = "form1" name = "form1" method = "post" action = "" >
<table width = "100%" border = "0" >
<tr >
<td width = "36%" > Категория:</ td >
<td width = "64%" ><select name = "table" id = "table" >
{table_options}
</ select > </ td >
</ tr >
<tr >
<td > Диапазон дат:</ td >
<td ><input id = "datepicker" type = "text" name = "date12" size = "23" maxlength = "23" value = "" ></ td >
</ tr >
</ table >
<p > </ p >
<p align = "center" >
<input type = "submit" name = "stat" id = "stat" value = "Показать" / >
</ p >
</ form >
<h1 > </ h1 >
</ div >
<div id = "footer" >
<!-- end #footer -->
</ div >
<!-- end #container --> </ div >
</ body >
</ html >
Подскажите, пожалуйста!
(Добавление)
Формат даты в БД - timestamp.
quinlena
Отправлено: 05 Мая, 2012 - 12:10:04 • Тема: Помогите с автокомплитом, пожалуйста!!! • Форум: Вопросы новичков
Ответов: 0 Просмотров: 70
Как этот файл правильно вставить в следующий.
PHP:
скопировать код в буфер обмена
<?PHP
/* Подключаетесь к базе и
/* выбираете из нужной таблицы
/* нужный столбец */
// Выводите как простой текст
header ( "Content-type: text/html; charset=windows-1251" ) ; $pz1 = $_GET [ 'q' ] ;
$pz = iconv ( "UTF-8" , "WINDOWS-1251" , $pz1 ) ; $res = mysql_query ( "SELECT * FROM dir_service WHERE name_service LIKE '$pz %'" ) ; {
echo $street [ 'name_service' ] . "\r \n " ;
}
?>
PHP:
скопировать код в буфер обмена
<?PHP
include_once ( "./common.php" ) ;
$link = _mysql_connect( "vol_base" ) ;
$fname = './tpl/request.html' ;
if ( isset ( $_POST [ 'act' ] ) == "insert" ) { $datetime_request = addslashes ( $_POST [ 'datetime_request' ] ) ; $req = intval ( $_POST [ 'name_type_request' ] ) ; $requ = intval ( $_POST [ 'name_type_1request' ] ) ; $n_cl = intval ( $_POST [ 'name_cl' ] ) ; $serv = intval ( $_POST [ 'autocomplete' ] ) ;
$sql = sprintf ( "INSERT INTO `segment_request` (`datetime_request`,`id_type_request`,`id_type_1request`,`id_client`,`id_service`) VALUES ('%s ','%d ','%d ','%d ','%d ')" ,
$datetime_request ,
$req ,
$requ ,
$n_cl ,
$serv
) ;
//echo $sql;die();
}
} elseif ( isset ( $_POST [ 'act' ] ) == "update" ) {
$sql = "UPDATE `segment_request` SET `datetime_request`='" . $datetime_request . "',``=''" ;
} else {
$req = mysql_query ( "SELECT `id_type_request`,`name_type_request` FROM `type_request`" , $link ) ; $req_options = '' ;
$req_options .= "<option value='" . $row [ 'id_type_request' ] . "'>" . $row [ 'name_type_request' ] . "</option>" ;
}
$content = replace_vars( "{type_options}" , $req_options ) ;
$requ = mysql_query ( "SELECT `id_type_1request`,`name_type_request` FROM `type_1request`" , $link ) ; $type_options = '' ;
$type_options .= "<option value='" . $row [ 'id_type_1request' ] . "'>" . $row [ 'name_type_request' ] . "</option>" ;
}
$content = replace_vars( "{type1_options}" , $type_options ) ;
$n_cl = mysql_query ( "SELECT `id_client`,`name_client` FROM `clients`" , $link ) ; $cli_options = '' ;
$cli_options .= "<option value='" . $row [ 'id_client' ] . "'>" . $row [ 'name_client' ] . "</option>" ;
}
$content = replace_vars( "{cli_options}" , $cli_options ) ;
$rel = mysql_query ( "SHOW TABLE STATUS FROM `vol_base` LIKE 'segment_request'" , $link ) ; $id_request2 = $row [ 'Auto_increment' ] ;
replace_vars( "{id_req}" , $id_request2 ) ;
$content = replace_vars( "{action}" , "insert" ) ;
}
echo $fcontent ;
?>
И сделать так, чтобы в таблицу заносилось id того, что набрано в автокомплите?
quinlena
Отправлено: 28 Апреля, 2012 - 19:25:30 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков
Ответов: 11 Просмотров: 468
Вообще данный код работает исправно из файла dat. Я просто узнаю про базу mysql...
(Добавление)
Мне бы простое автозаполнение из базы mysql, даже без зависимого поля...
quinlena
Отправлено: 28 Апреля, 2012 - 19:09:23 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков
Ответов: 11 Просмотров: 468
Panoptik пишет: а сервер вообще вам возвращает чтото.
вы хотите сделать всё и сразу. тут нужно поэтапно определять работоспособность отдельных частей приложения
В примере дан вот такой код php
PHP:
скопировать код в буфер обмена
<?PHP
header ( 'Content-Type: text/html; charset=utf-8' ) ; if ( $_SERVER [ 'HTTP_X_REQUESTED_WITH' ] == 'XMLHttpRequest' ) {
if ( $_GET [ 'q' ] ) {
$base = @ file ( "autocomplete.dat" ) ; for ( $i = 0 ; $i < count( $base ) ; $i ++ ) {
$row_base = explode ( ":" , $base [ $i ] ) ; if ( $res !== false&& $res == 0) {
$row_base [ 3
] = trim ( $row_base [ 3
] ) ; print $row_base [ 1 ] . "|" . $row_base [ 3 ] . "|" . $row_base [ 2 ] . "|" . $row_base [ 0 ] . "\n " ;
}
}
}
}
?>
Разве не нужно html подключать?
(Добавление)
Panoptik пишет: а сервер вообще вам возвращает чтото.
вы хотите сделать всё и сразу. тут нужно поэтапно определять работоспособность отдельных частей приложения
Все, дошло)) нужно html запускать, а не пхп... А можно код перестроить на подключение к базе mysql?
quinlena
Отправлено: 28 Апреля, 2012 - 18:48:01 • Тема: Не работает jquery autocomplete • Форум: Вопросы новичков
Ответов: 11 Просмотров: 468
Я кстати пробовала по этому примеру и почему-то не вышло. Там версия 1.2, а сейчас на сайте 1.7. Возможно это повлияло...
(Добавление)
Щас попробую еще раз сделать. Отпишусь.
(Добавление)
Вообще даже вывод не происходит(((
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:
скопировать код в буфер обмена
<?PHP
/* Подключаетесь к базе и
/* выбираете из нужной таблицы
/* нужный столбец */
// Выводите как простой текст
header ( "Content-type: text/html; charset=windows-1251" ) ; $pz1 = $_POST [ 'value' ] ;
$pz = iconv ( "UTF-8" , "WINDOWS-1251" , $pz1 ) ; $res = mysql_query ( "SELECT * FROM gender WHERE name_gen LIKE '$pz %'" ) ; {
echo '' . $street [ 'name_gen' ] . '' ;
}
?>
И код html...
CODE (
html ):
скопировать код в буфер обмена
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns= "http://www.w3.org/1999/xhtml" xml:lang = "ru" lang = "ru" >
<head >
<title > Autocomplete с помощью jQuery</ title >
<meta http-equiv = "Content-Language" content = "ru" / >
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
<style type = "text/css" >
* {
margin:0;
padding:0;
}
html, body {
background-color:#FFF;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
}
.ac_results {
padding: 0px;
border: 1px solid WindowFrame;
background-color: Window;
overflow: hidden;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results iframe {
display:none;/*sorry for IE5*/
display/**/:block;/*sorry for IE5*/
position:absolute;
top:0;
left:0;
z-index:-1;
filter:mask();
width:3000px;
height:3000px;
}
.ac_results li {
position:relative;
margin: 0px;
padding: 2px 5px;
cursor: pointer;
display: block;
width: 100%;
font: menu;
font-size: 12px;
overflow: hidden;
}
.ac_loading {
background : Window url('autocomplete_indicator.gif') right center no-repeat;
}
.ac_over {
background-color: Highlight;
color: HighlightText;
}
#example {
position:absolute;
top:10px;
left:10px;
width:150px;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
#example2 {
position:absolute;
top:10px;
left:170px;
width:240px;
font-family: "Trebuchet MS", Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
}
.qnt {
position:absolute;
top:2px;
right:10px;
font-size:0.8em;
color:#26A908;
}
</ style >
</ head >
<body >
<input name = "autocomlete" type = "text" id = "autocomplete" / >
<script type = "text/javascript" src = "jquery/jquery.js" ></ script >
<script type = "text/javascript" src = "jquery/jquery.autocomplete.js" ></ script >
<script type = "text/javascript" >
$(document).ready(function() {
$('#autocomplete').autocomplete('backend1.php', {
delay:10,
minChars:1,
matchSubset:1,
autoFill:true,
maxItemsToShow:10
}
);
});
</ script >
</ body >
</ html >
Помогите, пожалуйста, как сделать, чтоб автозаполнение было...
Страниц (11): В начало « ... 3 4 5 6 7 8 [9] 10 11 »
Powered by ExBB FM 1.0 RC1. InvisionExBB