这是我在学习锋利的 jquery 书中 5.1.4 的代码时遇到的一个小问题,源代码如下: <head> <style type="text/css"> * { margin:0; padding:0; } div.centent { float:left; text-align: center; margin: 10px; } span { display:block; margin:2px 2px; padding:4px 10px; background:…
select change下拉框改变事件 设置选定项,禁用select 1 <!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&…
jq自定义下拉菜单,在点击非当前下拉菜单区域时,关闭下拉菜单(点击事件的对象不是目标元素本身) //点击非当前下拉菜单区域时,关闭下拉菜单 $(document).mousedown(function(e){ var _con = $('.xialacaidan'); //1. 点击事件的对象不是目标元素本身 //2. 事件对象同时也不是目标元素的子元素 if(!_con.is(e.target) && _con.has(e.target).length===0){ $('.xialaca…
jq自定义下拉菜单,当用户点击非自身元素(下拉菜单)本身时关闭下拉菜单 截图: 代码如下: //关闭用户菜单 $(document).mousedown(function(e){ var _con = $('.drop_down'); //1. 点击事件的对象不是目标元素本身 //2. 事件对象同时也不是目标元素的子元素 if(!_con.is(e.target) && _con.has(e.target).length===0){ $('.drop_down').css('display…
var selectA1 = $("select[name=A1]"); //从A1下拉框中 搜索值 $(selectA1).children("option").each(function () { //console.log(this.index); //console.log($(this).text());//每一个option if ($(this).text() === A1) { $("select[name=A1]").find(…
实现过程 实现一个简易的鼠标悬停菜单项显示其子项的下拉框控件.将用到 CSS 绝对定位.流式布局.动画等:JQuery 鼠标移入和移出事件.DOM 查找.效果图如下: HTML 结构: <div class="dropdown-group"> <div class="dropdown"> <div class="label">菜单1</div> <div class="items&q…
作业一:两个列表之间数据从一个列表移动到另一个列表 <div style="width:600px; height:500px; margin-top:20px"> <div style="width:200px; height:300px; float:left"> <select id="list1" size="10" style="width:200px; height:300p…
$(function(){ var sex=$("#sex").val(); var marriageStatus=$("#marriageStatus").val(); var education=$("#education").val(); if(!isnull(sex)){ $("input:radio[name='sex'][value="+sex+"]").attr('checked','true…
var x=0; var isloading=0; function getUsersLimited(data) { list = list.concat(data); buildList(list); isloading=0; console.log(data.length) } $(document).ready(function(){ $(window).scroll(function() { if($(window).scrollTop()+$(window).height()+5>$(…
<asp:DropDownList ID="ddlRegionList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDeptList_SelectedIndexChanged"> <asp:ListItem>是</asp:ListItem> <asp:ListItem>否</asp:ListI…