当前位置:Gxlcms > JavaScript > 基于jQuery实现仿51job城市选择功能实例代码_jquery

基于jQuery实现仿51job城市选择功能实例代码_jquery

时间:2021-07-01 10:21:17 帮助过:34人阅读

前些文章用写过,省市县三级联动,但是感觉选择的时候不够直观,现在改进了下,效果如下图

输出的数据包含城市数据 tipDiv.bind("mouseover", function () { tipDiv.show(); isoncityDiv = true; //鼠标在其上为true }).bind("mouseout", function () { tipDiv.hide(); }); $("body").append(tipDiv); //加入body var top = spanCurrent.offset().top; //获取top var left = spanCurrent.offset().left; //获取left tipDiv.offset({ top: top + 20, left: left + 60 }); tipDiv.show(); //获取显示div }).bind("mouseout", function () { var spanCurrent = $("#city_" + $(this).attr("id")); var a = function () { if (!isoncityDiv) { //不在 弹出的div上时候 执行 spanCurrent.remove(); } clearTimeout(int); }; var int = setTimeout(a, 3000); }); }); //关闭谈出口 function show(title) { parent.closeDiv(title); }

以上内容给大家介绍了基于jQuery实现仿51job城市选择功能实例代码,希望对大家有所帮助!

人气教程排行