<body> <script type="text/javascript"> function click_scroll() { var scroll_offset = $("#pos").offset(); //得到pos这个div层的offset,包含两个值,top和left $("body,html").animate({ scrollTop:scroll_offset.top //让body的scrollTop等于…
使用jQuery实现点击左右滑动切换特效: HTML代码如下: <!--整体背景div--> <div class="warp"> <!--中间内容div--> <div class="divContent"> <div class="content"> <ul class="contentUl"> <li> <img src="…
JQuery实现切换图片相对比较简单,直接贴代码了哈,有注释噢!疑问请追加评论哈,不足之处还请大佬们指出! 1.案例代码: demo.html: <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>JQuery实现点击按钮切换图片</title> <style type="text/css"> *{ margin:0;…
昨天做项目遇到一个问题,和大家分享下,jquery实现点击按钮弹出层和点击空白处隐藏层的问题 if($('.autoBtn').length){                $('.autoBtn').find('.assess').unbind().bind('click',function(event){                    //取消事件冒泡                      event.stopPropagation(); if($('.abtnBox').is…
一般我们用 mRecycleview.smoothScrollToPosition(0)滑动到顶部,具有滚动效果,但是如果我们想滚动到任意指定位置,那么smoothScrollToPosition()就不能保证所指定item位于屏幕顶部,那么一下提供下我解决的方法: 1.第一种方法 此方法能实现指定位置位于屏幕顶部,但是不具有平滑滚动视觉效果: if (position != -1) { mRecycleview.scrollToPosition(position); LinearLayoutM…
原文链接:http://www.cnblogs.com/steed-zgf/archive/2012/02/03/2336984.html <!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.or…
<script type="text/javascript"> $(document).click(function(e){ e = window.event || e; var obj = e.srcElement || e.target; if(!$(obj).is("#keywords-area ul li")) { $("#keywords-area").hide(); } }); </script> 说明: 1.…
注意:dmenu是一个div的class名哦 代码如下 复制代码 $('html,body').click(function(e){  if(e.target.id.indexOf("dmenu")==-1){      $("ul").hide();  } }); $(".dmenu").click(function(){    $(this).next("ul").show();}); 更多详细内容请查看:http://w…
<!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> <script src="HTML/js/jquer…
jquery实现页面条件筛选 此功能类似淘宝的条件筛选,主要是页面样式的更改,问了大神也磨磨唧唧了很久才搞定0.0.... 先贴代码..... 代码知识有 border-radius 设置圆角边框 siblings() 同胞元素,这个是重点 <style type="text/css"> .list dd{margin:-20px 0px 0px 40px;} .list dd a{padding-right:10px; text-decoration: none;} .s…