我添加了两个jQuery UI Dropdown Autocomplete脚本.现在我希望获得第二个下拉列表的值,并希望单独存储在变量中.怎么可能?
任何想法或建议?谢谢.
我的小提琴: 样品
我的JS代码:
(function($) {
$.widget("ui.combobox", {
_create: function() {
var self = this,
select = this.element.hide(),
selected = select.children(":selected"),
value = selected.val() ? selected.text() : "";
var input = this.input = $("<input>").insertAfter(select).val(value).autocomplete({
delay: 0,
minLength: 0,
source: function(request, response) {
var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
response(select.children("option").map(function() {
var text = $(this).text();
if (this.value && (!request.term || matcher.test(text)))
return {
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
value: text,
option: this
}; …
Run Code Online (Sandbox Code Playgroud) 我有这个正则表达式 /^\d(\d|\,\d{3}|,\d.+$)*$/
使用我的示例数据:
100.00 - Not working :(
1,000.00 - Working
100,000.00 - Working
1,000,000.00 - Working
Run Code Online (Sandbox Code Playgroud)
注意:如果结果为0.00,我需要给出错误
任何想法或建议?谢谢.
我试图在谷歌地图中使用带有css3 border-radius属性的圆形边框,但它不适用于chrome,在其他浏览器中它的工作效果很好.任何想法或建议?在这里,我将我的代码和等待积极的答复.谢谢
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Testing</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<style type="text/css" >
#map {
position: absolute;
top: 120px;
left: 0;
right: 0;
bottom:0;
z-index: 1;
overflow: hidden;
border:solid 3px #00FF33;
border-radius:15px;
width: 500px;
height: 200px;
margin:0 auto;
-moz-border-radius:15px;
-webkit-mask-border-radius:15px;
-webkit-border-radius:15px;
}
#wrapper {
position:absolute;
}
</style>
<div id="wrapper">
<div id="map" ></div>
</div>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
center: new google.maps.LatLng(-33.92, 151.25),
mapTypeId: google.maps.MapTypeId.ROADMAP …
Run Code Online (Sandbox Code Playgroud) 我想用给定集合中的随机值更新我的表,而不是从另一个表.
例如value1,value2,value3
和MySQL查询应该更新上述值的所有记录.
我正在寻找类似类型的解决方案,但具有来自给定集合的随机字符串值: 具有随机值的更新列
我正在尝试在标签点击事件上初始化Google地图,因为目前我正在获取这样的地图:
我的代码:
(function($) {
/*
* render_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0
*
* @param $el (jQuery element)
* @return n/a
*/
function render_map( $el ) {
// var
var $markers = $el.find('.marker');
// vars
var args = {
zoom : 16,
center : new google.maps.LatLng(0, 0),
mapTypeId : google.maps.MapTypeId.ROADMAP
};
// create map
var map = new google.maps.Map( $el[0], args); …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用下拉列表更改 google-map 中的半径圆,例如,当我从下拉列表中选择 2 公里时,它将被设置为 2.0 半径,如果我选择 4 公里,它将被设置为 4.0 半径。在这一点上,一切正常,但现在问题是在第二次选择后,第一个存在并没有从圆圈中删除。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
<link rel="stylesheet" type="text/css" href="/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<style type='text/css'>
#map_canvas {
background:#ccc;
height:400px;
width:50%;
margin-top:15px;
}
</style>
<select name="distance" id="distance">
<option value="0.5" selected="selected">0.5 km</option>
<option value="1.0">1 km</option>
<option value="2.0">2 km</option>
<option value="3.0">3 km</option>
<option value="4.0">4 km</option>
<option value="5.0">5 km</option>
</select>
<script type='text/javascript'>//<![CDATA[
jQuery.noConflict();
jQuery(document).ready(function() {
var subjectRange;
var myOptions = {
zoom: 13,
center: latlng, …
Run Code Online (Sandbox Code Playgroud) 我正在使用WordPress并使用jQuery fancyBox显示YouTube视频,但我收到此错误:
XMLHttpRequest cannot load http://www.youtube.com/embed/L9szn1QQfas?autoplay=1. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
Run Code Online (Sandbox Code Playgroud)
我jQuery code
在footer.php中添加了bellow
$(document).ready(function() {
$(".fancybox").fancybox();
});
Run Code Online (Sandbox Code Playgroud)
并在我的帖子中添加了低于html的代码.
<a class="fancybox fancybox.iframe" href="http://www.youtube.com/embed/L9szn1QQfas?autoplay=1">
<img class="alignleft size-thumbnail wp-image-583" alt="small-screen-youtube" src="http://localhost/example/wp-content/uploads/2013/10/small-screen-youtube-150x150.png" width="150" height="150" />
</a>
Run Code Online (Sandbox Code Playgroud)
这个问题杀了我:(
任何想法或建议?谢谢.
例如,我创建了两个表.
表一:t5zgu_property_message
msg_from msg_to subject message
57 42 xxxxx xxxxxx
57 42 xxxxx xxxxxx
57 42 xxxxx xxxxxx
42 42 xxxxx xxxxxx
Run Code Online (Sandbox Code Playgroud)
表二:t5zgu_users
id username
42 Jack
57 Rocky
Run Code Online (Sandbox Code Playgroud)
我希望输出像这样:
msg_from msg_to subject message msg_from msg_to
57 42 xxxxx xxxxxx Rocky Jack
57 42 xxxxx xxxxxx Rocky Jack
57 42 xxxxx xxxxxx Rocky Jack
42 42 xxxxx xxxxxx Jack Jack
Run Code Online (Sandbox Code Playgroud)
我目前的查询是:
SELECT
t5zgu_property_message.id,
t5zgu_property_message.msg_from,
t5zgu_property_message.msg_to,
t5zgu_property_message.subject,
t5zgu_property_message.message,
t5zgu_users.username as msg_from
FROM
t5zgu_property_message,
t5zgu_users
WHERE
t5zgu_property_message.msg_from = t5zgu_users.id
ORDER BY t5zgu_property_message.id …
Run Code Online (Sandbox Code Playgroud) google-maps ×3
jquery ×2
mysql ×2
php ×2
css3 ×1
fancybox ×1
javascript ×1
jquery-ui ×1
random ×1
regex ×1
sql ×1
validation ×1
wordpress ×1
youtube ×1