ITeye博客

jquery

共 3 篇文章

jQuery选择器大全

选择器是jQuery最基础的东西,本文中列举的选择器基本上囊括了所有的jQuery选择器,也许各位通过这篇文章能够加深对jQuery选择器的理解,它们本身用法就非常简单,我更希望的是它能够提升个人编写jQuery代码的效率。本文配合截图、代码和简单的概括对所有jQuery选择器进行了介绍,也列举出了一些需要注意和区分的地方。 一、基本选择器 1. id选择器(指定id元素) 将id="one"的元素背景色设置为黑色。(id选择器返单个元素) $(document).ready(function () { $('#one').css('background', '#000'); }); 2. …

2014-01-09 10:59 · jquery

jquery滚轮滚动到页面底部异步加载数据

var totalheight = 0; function loadData(){ totalheight = parseFloat(jQuery(window).height()) + parseFloat(jQuery(window).scrollTop()); if (jQuery(document).height() <= totalheight) { jQuery.post("",{},function(data){ if(data!=null && data.trim()!=""){ if(count%4==0){ jQuery(".chapter_content").html(…

2013-12-30 18:00 · jquery

jQuery对表单元素的取值和赋值

$("#keyword")[0].value = ""; /*获得TEXT.AREATEXT的值*/ var textval = $("#text_id").attr("value"); //或者 var textval = $("#text_id").val(); /*获取单选按钮的值*/ var valradio = $("input[type=radio]:checked").val(); /*获取一组名为(items)的radio被选中项的值*/ var item = $('input[name=items]:checked').val(); /*获取复选框的值*/ var chec…

2013-11-13 16:47 · jquery