360浏览器,猎豹浏览器会出现点击input输入框时,输出框获取焦点的问题

小大飞 2019-11-07 04:50:27
系统中有个功能,点击input、或者input获取焦点,输入框下弹出一个div,div中展示数据供用户选择,当用户点击页面其他地方时,div隐藏。
现在有个问题:在360浏览器,猎豹浏览器中,假如用户上一个input输入的内容比较多,点击下面的input总是上面的input获取焦点很奇怪的问题,这种问题怎么修复?



如图,其实点击输入框的上面附件区域,input也能获取到焦点。现在是这会导致,用户无法点击到下面第二个input,总是上面的那个input获取到焦点。
...全文
661 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
小大飞 2019-11-11
  • 打赏
  • 举报
回复
if (k > options.suggestLength * (pageIndex - 1) && k <= options.suggestLength * pageIndex) {
$(this).css('display', 'block');
} else {
$(this).hide();
}
});
setTopSelect();
setAddPageHtml(pageIndex);
}
function setAddPageHtml(pageIndex) {
var cityPageBreak = suggestMain.find('.page_break');
cityPageBreak.empty();
if (suggestMain.find('.list_city_container').children().length > options.suggestLength) {
var pageBreakSize = Math.ceil(suggestMain.find('.list_city_container').children().length / options.suggestLength);
if (pageBreakSize <= 1) {
return;
}
var start = end = pageIndex;
for (var index = 0, num = 1; index < options.pageLength && num < options.pageLength; index++) {
if (start > 1) {
start--; num++;
}
if (end < pageBreakSize) {
end++; num++;
}
}
// if (pageIndex > 1) {
// cityPageBreak.append("<a href='javascript:void(0)' role='pageIndex' inum='" + (pageIndex - 1) + "'><-</a>");
// }
for (var i = start; i <= end; i++) {
if (i == pageIndex) {
cityPageBreak.append("<a href='javascript:void(0)' role='pageIndex' class='current' inum='" + (i) + "'>" + (i) + "</a");
} else {
cityPageBreak.append("<a href='javascript:void(0)' role='pageIndex' inum='" + (i) + "'>" + (i) + "</a");
}
}
// if (pageIndex < pageBreakSize) {
// cityPageBreak.append("<a href='javascript:void(0);' role='pageIndex' inum='" + (i) + "'>-></a>");
// }
cityPageBreak.show();
//suggestMain.show();
} else {
cityPageBreak.hide();
}
return false;
}
function setTopSelect() {
if (suggestMain.find('.list_city_container').children().length > 0) {
suggestMain.find('.list_city_container').children(':visible').eq(0).addClass('selected');
}
}
function onSelect() {
if (typeof options.onSelect == 'function') {
alert(1);
}
}
function popInit() {
var index = 0;
popMain.find('.pop_head').html(options.popTitleText);
if (!options.tabs) {
popContainer.append("<ul id='label_" + input.attr('id') + "_container' name='TAB' class='current'></ul>");
labelMain.remove();
for (var Zitem in options.data) {
if (Zitem != "remove"
&& Zitem != "getCitySet"
&& Zitem != "getTimeField"
&& Zitem != "getDeliverSet"
&& Zitem != "getFlightSet"
&& Zitem != "IsEnable"
&& Zitem != "ReDisplay"
&& Zitem != "sortBy"
&& Zitem != "filter"
&& Zitem != "equalFilter"
&& Zitem != "equalRepulsionFilter"
&& Zitem != "unZipModel"
) {
$("#label_" + input.attr('id') + "_container").append("<li><a href='javascript:void(0)' citycode=" + options.data[Zitem][0] + ">" + options.data[Zitem][1] + "</a></li>");
}
}
return;
}
for (var itemLabel in options.tabs) {
if (itemLabel != "remove"
&& itemLabel != "getCitySet"
&& itemLabel != "getTimeField"
&& itemLabel != "getDeliverSet"
&& itemLabel != "getFlightSet"
&& itemLabel != "IsEnable"
&& itemLabel != "ReDisplay"
&& itemLabel != "sortBy"
&& itemLabel != "filter"
&& itemLabel != "equalFilter"
&& itemLabel != "equalRepulsionFilter"
&& itemLabel != "unZipModel"
) {
index++;
if (index == 1) {

popContainer.append("<ul id='label_" + input.attr('id') + index + "_container' name='TAB' class='current' data-type='" + itemLabel + "'></ul>");
labelMain.append("<li><a id='label_" + input.attr('id') + index + "' name='TAB' class='current' href='javascript:void(0)'>" + itemLabel + "</a></li>");
} else {
popContainer.append("<ul style='display:none' id='label_" + input.attr('id') + index + "_container' data-type='" + itemLabel + "'></ul>");
labelMain.append("<li><a id='label_" + input.attr('id') + index + "' name='TAB' href='javascript:void(0)'>" + itemLabel + "</a></li>");
}
for (var Aitem in options.tabs[itemLabel]) {

if (Aitem != "remove"
&& Aitem != "getCitySet"
&& Aitem != "getTimeField"
&& Aitem != "getDeliverSet"
&& Aitem != "getFlightSet"
&& Aitem != "IsEnable"
&& Aitem != "ReDisplay"
&& Aitem != "sortBy"
&& Aitem != "filter"
&& Aitem != "equalFilter"
&& Aitem != "equalRepulsionFilter"
&& Aitem != "unZipModel"
) {
var cityCode = options.tabs[itemLabel][Aitem];

if (!options.data[cityCode]) {
break;
}

$("#label_" + input.attr('id') + index + "_container").append("<li><a href='javascript:void(0)' citycode=" + options.data[cityCode][0] + ">" + options.data[cityCode][1] + "</a></li>");
}
}
}
}
}
function resetPosition() {
popMain.css({ 'top': input.offset().top + input.outerHeight(), 'left': input.offset().left });
suggestMain.css({ 'top': input.offset().top + input.outerHeight(), 'left': input.offset().left });
}
}
$.fn.querycity = function(options) {
var defaults = {
'data': {},
'tabs': '',
'hotList': '',
'defaultText': '中文/拼音',
'popTitleText': '请选择城市或输入城市名称或拼音',
'suggestTitleText': '输入中文/拼音或↑↓选择',
'suggestLength': 10,
'pageLength': 5,
'onSelect': '',
'nextIndex': null
};
var options = $.extend(defaults, options);
this.each(function() {
new $.querycity(this, options);
});
return this;
};
})(jQuery);



(function($) {
$.fn.bgIframe = $.fn.bgiframe = function(s) {
if ($.browser.msie && /6.0/.test(navigator.userAgent)) {
s = $.extend({
top: 'auto', // auto == .currentStyle.borderTopWidth
left: 'auto', // auto == .currentStyle.borderLeftWidth
width: 'auto', // auto == offsetWidth
height: 'auto', // auto == offsetHeight
opacity: true,
src: 'javascript:false;'
}, s || {});
var prop = function(n) { return n && n.constructor == Number ? n + 'px' : n; },
html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="' + s.src + '"' +
'style="display:block;position:absolute;z-index:-1;' +
(s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') +
'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' +
'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' +
'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' +
'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' +
'"/>';
var syleV = 'style="display:block;position:absolute;z-index:-1;' +
(s.opacity !== false ? 'filter:Alpha(Opacity=\'0\');' : '') +
'top:' + (s.top == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')' : prop(s.top)) + ';' +
'left:' + (s.left == 'auto' ? 'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')' : prop(s.left)) + ';' +
'width:' + (s.width == 'auto' ? 'expression(this.parentNode.offsetWidth+\'px\')' : prop(s.width)) + ';' +
'height:' + (s.height == 'auto' ? 'expression(this.parentNode.offsetHeight+\'px\')' : prop(s.height)) + ';' +
'"/>';




return this.each(function() {
if ($('> iframe.bgiframe', this).length == 0) {
var iframe = document.createElement("iframe");
iframe.setAttribute("class", "bgiframe");
iframe.setAttribute("frameborder", "0");
iframe.setAttribute("tabindex", "-1");
iframe.setAttribute("src", s.src);
iframe.setAttribute("style", syleV);
// this.insertBefore(iframe, this.firstChild);
// this.insertBe
小大飞 2019-11-11
  • 打赏
  • 举报
回复
if (13 == keyCode) {
var $nameSelected = suggestMain.find('.list_city_container a.selected');
if ($nameSelected.length > 0) {
var cityname = $nameSelected.children('b').first().text();
var cityCode = $nameSelected.children('span').text();
input.val(cityname + '(' + cityCode + ')');
// $("#hid" + input[0].id).val(cityCode);
$('#' + input[0].id).attr('citycode', cityCode).attr('cityname', cityname);
suggestMain.hide();
//yangxubo修改
if (options.nextIndex != null && options.nextIndex != "undefined") {
options.nextIndex.focus();
return false;
}
}
}

}).keyup(function(event) {
event = window.event || event;
var keyCode = event.keyCode || event.which || event.charCode;
if (keyCode != 13 && keyCode != 37 && keyCode != 39 && keyCode != 9 && keyCode != 38 && keyCode != 40) {
//keyCode == 9是tab切换键
queryCity();
}
});
$(document).click(function(event) {
var sdaf = event.target.name;
if (event.target.id != "pop_city_txtDepartCity" && event.target.id != "suggest_city_txtDestCity" && event.target.id != "txtDepartCity" && event.target.id != "txtDestCity" && event.target.name != "TAB" && event.target.role != "pageIndex") {
$("#pop_city_txtDepartCity").hide();
$("#suggest_city_txtDestCity").hide();

if (DestCityStatus_Inter == 0 && $('#pop_city_txtDestCity').is(':hidden') == false) {
$("#pop_city_txtDestCity").hide();
$("#suggest_city_txtDestCity").hide();
}

DestCityStatus_Inter = (DestCityStatus_Inter == 2 ? 1 : 0);
}
});
suggestMain.find('.list_city_container a').live('click', function() {
var cityCode = eachCityCode($(this).children('span').text());

//$("#hid" + input[0].id).val(cityCode);

$('#' + input[0].id).attr('citycode', cityCode).attr('cityname', $(this).children('b').first().text());

input.val($(this).children('b').first().text() + '(' + cityCode + ')');
suggestMain.hide();

if (options.nextIndex != null && options.nextIndex != "undefined") {
if (options.nextIndex.attr("id") == "txtDestCity") {
DestCityStatus_Inter = 2;
}
options.nextIndex.focus();
return false;
}



}).live('mouseover', function() {
t_suggest_focus = true;
}).live('mouseout', function() {
t_suggest_focus = false;
});
suggestMain.find('.page_break a').live('mouseover', function() {
t_suggest_focus = true;
}).live('mouseout', function() {
t_suggest_focus = false;
});
suggestMain.find('.page_break a').live('click', function(event) {
t_suggest_page_click = true;
input.click();
if ($(this).attr('inum') != null) {
setAddPage($(this).attr('inum'));
}
return false; // 避免冒泡事件
});

function eachCity(cityName) {

var reusltMsg = "";
$.each(citysFlight, function(y, Cval) {
if (Cval[1] == cityName) {
reusltMsg = Cval[0].toUpperCase();
}
})
return reusltMsg;
}
function eachCityCode(cityCode) {
var reusltMsg = "";
$.each(citysFlight, function(y, Cval) {
if (Cval[0] == cityCode) {
reusltMsg = Cval[0].toUpperCase();
}
})
return reusltMsg;
}

function nextPage() {
var add_cur = suggestMain.find(".page_break a.current").next();
if (add_cur != null) {
if ($(add_cur).attr("inum") != null) {
setAddPage($(add_cur).attr("inum"));
}
}
}
function prevPage() {
var add_cur = suggestMain.find(".page_break a.current").prev();
if (add_cur != null) {
if ($(add_cur).attr("inum") != null) {
setAddPage($(add_cur).attr("inum"));
}
}
}
function nextResult() {
var t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a.selected')[0]);
suggestMain.find('.list_city_container').children().removeClass('selected');
t_index += 1;
var t_end = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').filter(':last')[0]);
if (t_index > t_end) {
t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').eq(0));
}
suggestMain.find('.list_city_container a').eq(t_index).addClass('selected');
}
function prevResult() {

var t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a.selected')[0]);
suggestMain.find('.list_city_container').children().removeClass('selected');
t_index -= 1;
var t_start = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').filter(':first')[0]);
if (t_index < t_start) {
t_index = suggestMain.find('.list_city_container a').index(suggestMain.find('.list_city_container a:visible').filter(':last')[0]);
}
suggestMain.find('.list_city_container a').eq(t_index).addClass('selected');
}
function loadCity() {
var cityList = suggestMain.find('.list_city_container');
cityList.empty();
if (options.hotList) {
var hotList = options.hotList;
} else {
var hotList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
}
$.each(hotList, function(n, Xitem) {
if (n > options.suggestLength) {
return;
}
var _data = options.data[Xitem];
if (_data.length > 8) {
cityList.append("<a href='javascript:void(0)' ><span>" + _data[0] + "</span><b>" + _data[1] + "</b> <b>(" + _data[7] + ")</b> <b style=\"display:block\">" + _data[8] + "</b></a>"); //<br/><b>" + _data[8] + "</b>
}
else {
cityList.append("<a href='javascript:void(0)' ><span>" + _data[0] + "</span><b>" + _data[1] + "</b></a>");
}
});

suggestMain.find('.list_city_head').html(options.suggestTitleText);
setAddPage(1);
suggestMain.show();
setTopSelect();
}
function queryCity() {
popMain.hide();
var value = input.val().toUpperCase(); //.toLowerCase();
if (value.length == 0) {
loadCity();
return;
}
var city_container = suggestMain.find('.list_city_container');
var isHave = false;
var _tmp = new Array();

$.each(options.data, function(n, Yitem) {
var _data = Yitem;
if (typeof (_data) != 'undefined') {
if (_data.length > 8) {
if (_data[7].toUpperCase().indexOf(value) >= 0 || _data[3].toUpperCase().indexOf(value) >= 0 || _data[2].toUpperCase().indexOf(value) >= 0 || _data[1].toUpperCase().indexOf(value) >= 0 || _data[0].toUpperCase().indexOf(value) >= 0) {
isHave = true;
_tmp.push(_data);
}
}
else {
if (_data[3].toUpperCase().indexOf(value) >= 0 || _data[2].toUpperCase().indexOf(value) >= 0 || _data[1].toUpperCase().indexOf(value) >= 0 || _data[0].toUpperCase().indexOf(value) >= 0) {
isHave = true;
_tmp.push(_data);
}
}

}
});
//city_container.empty(); // 有没有数据都清除 by jlli 2015/03/23
if (isHave) {
city_container.empty();
$.each(_tmp, function(n, Bitem) {
var _data = Bitem;
if (_data.length > 8) {
city_container.append("<a href='javascript:void(0)' role='pageIndex' style='display:none'><span>" + _data[0] + "</span><b>" + _data[1] + "</b> <b>(" + _data[7] + ")</b><b style=\"display:block\">" + _data[8] + "</b></a>");
}
else {
city_container.append("<a href='javascript:void(0)' role='pageIndex' style='display:none'><span>" + _data[0] + "</span><b>" + _data[1] + "</b></a>");
}
});
suggestMain.find('.list_city_head').html(value + ",按拼音排序");
setAddPage(1);
setTopSelect()
} else {
suggestMain.find('.list_city_head').html("<span class='msg'>对不起,找不到" + value + "</span>");
}
suggestMain.show();
}
function setAddPage(pageIndex) {

suggestMain.find('.list_city_container a').removeClass('selected');
suggestMain.find('.list_city_container').children().each(function(i) {
var k = i + 1;
if (k > options.suggestLength * (pageIndex - 1) && k <= options.suggestLength * pageIndex) {
小大飞 2019-11-11
  • 打赏
  • 举报
回复
/// <reference path="../../public/jquery-1.11.0-vsdoc.js" />
var citysFlight = [];
var DestCityStatus_Inter = 0;
var IsNewInterfaceI = 0; //0:不使用新接口 1:使用新接口

$(document).ready(function() {
//循环热门城市
var labelFromcity = new Array();
var labelFromcitydd = new Array();
var hotList = hotListAPPI;
labelFromcity = departCity_LabelFromcity;
$('#txtDepartCity').querycity({ 'data': citysFlight, 'tabs': labelFromcity, 'hotList': hotList, 'nextIndex': null });
//国际多程 出发城市
$('.inputcitydepart').querycity({ 'data': citysFlight, 'tabs': labelFromcity, 'hotList': hotList, 'nextIndex': null });

labelFromcitydd = destCity_LabelFromcity;
$('#txtDestCity').querycity({ 'data': citysFlight, 'tabs': labelFromcitydd, 'hotList': hotList, 'nextIndex': null });
//国际多程 到达城市
$(".inputcitydest").querycity({ 'data': citysFlight, 'tabs': labelFromcitydd, 'hotList': hotList, 'nextIndex': null });

})
function GetCity(filter) {
var zm = [];
$.each(citysFlight, function(key, value) {

if (value[6] != "" && value[6] != null) {
var py = value[6].toUpperCase();

if (filter == "1") {
if (py.indexOf("GJ") > -1) {
zm.push(key);
}
} else if (filter == "2") {
if (py.indexOf("GN") > -1) {
zm.push(key);
}
} else if (filter == "3") {
if (py.indexOf("YZ") > -1) {
zm.push(key);
}
} else if (filter == "4") {
if (py.indexOf("OZ") > -1) {
zm.push(key);
}
} else if (filter == "5") {
if (py.indexOf("MZ") > -1) {
zm.push(key);
}
} else if (filter == "6") {
if (py.indexOf("FZ") > -1) {
zm.push(key);
}
} else if (filter == "7") {
if (py.indexOf("DY") > -1) {
zm.push(key);
}
}

}
})
return zm;
}



(function($) {
if (citysFlight.length == 0) {
//初始化各个城市
citysFlight.length = 0;
citysFlight = citysFlightIAPP;
}
$.querycity = function (input, options) {
console.log("------检查绑定城市事件-------------begin--------------------");
console.log(input);
console.log(options);
console.log($(input).attr("id"));
console.log("------检查绑定城市事件-------------end--------------------");

var input = $(input);
input.attr('autocomplete', 'off');

//yxb添加 start
//设置不显示pop层 当为1时不显示
var tmp_noshowpop = input.attr('no_showpop');
//yxb添加 end

if ($.trim(input.val()) == '' || $.trim(input.val()) == options.defaultText) {
input.val(options.defaultText).css('color', '#000');
}
var t_pop_focus = false;
var t_suggest_focus = false;
var t_suggest_page_click = false;

var isExistsPopMain = $('body').find("#pop_city_" + input.attr('id'));
var isExistsSuggestMain = $('body').find("#suggest_city_" + input.attr('id'));

//国际多程,为了防止重复绑定的问题
if ((isExistsPopMain == null || isExistsPopMain.length == 0) && (isExistsSuggestMain == null || isExistsSuggestMain.length == 0)) {
$('body').append("<div id='pop_city_" + input.attr('id') + "' class='pop_city' style='display:none'><p class='pop_head'></p><ul class='list_label'></ul><div class='pop_city_container'></div></div>");
$('body').append("<div id='suggest_city_" + input.attr('id') + "' class='list_city' style='display:none'><div class='list_city_head'></div><div class='list_city_container'></div><div class='page_break'></div></div>");
} else {
$('body').find("#pop_city_" + input.attr('id')).remove();
$('body').find("#suggest_city_" + input.attr('id')).remove();

$('body').append("<div id='pop_city_" + input.attr('id') + "' class='pop_city' style='display:none'><p class='pop_head'></p><ul class='list_label'></ul><div class='pop_city_container'></div></div>");
$('body').append("<div id='suggest_city_" + input.attr('id') + "' class='list_city' style='display:none'><div class='list_city_head'></div><div class='list_city_container'></div><div class='page_break'></div></div>");
}

var popMain = $("#pop_city_" + input.attr('id'))
var popContainer = popMain.find('.pop_city_container');
var labelMain = popMain.find('.list_label');
var suggestMain = $("#suggest_city_" + input.attr('id'));
popMain.bgIframe();
suggestMain.bgIframe();
//加载数据
popInit();

resetPosition();

$(window).resize(function() {

resetPosition();
});

input.focus(function (e) {
console.log("focus---event-this-------focus事件-------------输出信息----------------");
console.log(e);
console.log(this);

resetPosition(); // 表示用于重新定位
if (t_suggest_page_click) {
t_suggest_page_click = false;
return true;
}
suggestMain.hide();
if ($.trim($(this).val()) == options.defaultText) {
$(this).val('').css('color', '#000');
}
popMain.show();
}).click(function() {
if (t_suggest_page_click) {
t_suggest_page_click = false;
return;
}
//选中文本
input.select();
suggestMain.hide();
popMain.show();
}).blur(function() {
if (t_pop_focus == false) {
popMain.hide();
if ($.trim(input.val()) == '' || $.trim(input.val()) == options.defaultText) {
input.val(options.defaultText).css('color', '#aaa');
}
}
});
labelMain.find('a').live('click', function() {
input.focus(); //使焦点在输入框,避免blur事件无法触发
t_pop_focus = true;
var labelId = $(this).attr('id');
labelMain.find('li a').removeClass('current');
$(this).addClass('current');
popContainer.find('ul').hide();
popContainer.find('div').hide();
$("#" + labelId + '_container').show();
$("#" + labelId + '_container ul').show();
});
popContainer.find('a').live('click', function() {
var cityCode = eachCityCode($(this).attr('citycode')); //eachCity($(this).html());
input.val($(this).html() + '(' + cityCode + ')');
// $("#hid" + input[0].id).val(cityCode);
$('#' + input[0].id).attr('citycode', cityCode).attr('cityname', $(this).html()); // lijunli update 2013/12/7
popMain.hide();
//yangxubo修改
if (options.nextIndex != null && options.nextIndex != "undefined") {
if (options.nextIndex.attr("id") == "txtDestCity") {
DestCityStatus = 2;
}
options.nextIndex.focus();
}
});
popMain.mouseover(function() {
t_pop_focus = true;
}).mouseout(function() {
t_pop_focus = false;
});

input.blur(function() {
if (t_suggest_focus == false) {
if ($(this).val() == '') {
//console.log(suggestMain.find('.list_city_container a.selected'));
var $nameSelected = suggestMain.find('.pop_city_container a.selected');
//debugger;
if ($nameSelected != null && $nameSelected.length > 0) {
var cityname = $nameSelected.children('b').first().text();
var cityCode = $nameSelected.children('span').text();
$(this).val(cityname + '(' + cityCode + ')');
// $("#hid" + $(this).id).val(cityCode);
$('#' + $(this).id).attr('citycode', cityCode).attr('cityname', cityname);
}

}
suggestMain.hide();
}
}).keydown(function(event) {

popMain.hide();
event = window.event || event;
var keyCode = event.keyCode || event.which || event.charCode;
if (keyCode == 37) {//左
prevPage();
} else if (keyCode == 39) {//右
nextPage();
} else if (keyCode == 38) {//上
prevResult();
} else if (keyCode == 40) {//下
nextResult();
}
if (9 == keyCode) {
var $nameSelected = suggestMain.find('.list_city_container a.selected');
if ($nameSelected.length > 0) {
var cityname = $nameSelected.children('b').first().text();
var cityCode = $nameSelected.children('span').text();
input.val(cityname + '(' + cityCode + ')');
//$("#hid" + input[0].id).val(cityCode);
$('#' + input[0].id).attr('citycode', cityCode).attr('cityname', cityname);
suggestMain.hide();
//yangxubo修改
if (options.nextIndex != null && options.nextIndex != "undefined") {
if (options.nextIndex.attr("id") == "txtDestCity") {
DestCityStatus_Inter = 2;
}
options.nextIndex.focus();
return false;
}
}
}
}).keypress(function(event) {
event = window.event || event;
var keyCode = event.keyCode || event.which || event.charCode;

if (13 == keyCode) {
var $nameSelected = sugg
horizon_zpy 2019-11-08
  • 打赏
  • 举报
回复
没法重现你的问题,能发个代码看看吗?只是浏览器不兼容?

5,006

社区成员

发帖
与我相关
我的任务
社区描述
解读Web 标准、分析和讨论实际问题、推动网络标准化发展和跨浏览器开发进程,解决各种兼容性问题。
社区管理员
  • 跨浏览器开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧