`

jquery hover hasClass insertBefore live blockUI children notice

    博客分类:
  • js
阅读更多

hover

 

    $(".onenote").hover(function(e) {
        $(this).children(".newnote_right_icon").removeClass("div_beHidden");
        e.stopPropagation();

    }, function() {
        $(this).children(".newnote_right_icon").addClass("div_beHidden");
    });

 

hasClass

    $(".onenote").click(function() {
        var obj = $(this).parent().children(".addCommentDiv")[0];
        if ($(obj).hasClass("div_beHidden")) {
            $(obj).removeClass("div_beHidden");
        } else {
            $(obj).addClass("div_beHidden");
        }
    });

live  和直接click的区别是以后新添加的元素也会受影响

    $(".deleteComment").live("click",function(e){
        $(this).parent().parent().parent().remove();
        e.stopPropagation();
    });

 

hover的live写法

    $(".onecomment").live('hover',function (ev) {
            if (ev.type == 'mouseover') {
                $(this).children().children(".right").removeClass("div_beHidden");
            }
            if (ev.type == 'mouseout') {
                $(this).children().children(".right").addClass("div_beHidden");
            }
    });
 

 

 

insertBefore

    $(".submitCommit").click(function() {
        $('.CommitTemplate').clone().removeClass("div_beHidden").removeClass("CommitTemplate").insertBefore($(this).parent().parent().parent());
        $(this).parent().parent().parent().addClass("div_beHidden");
    });
 

blockUI

    <script type="text/javascript" src="jquery/blockui/jquery.blockUI.js"></script>


	openWaitBlock();
	$.post(url,params,function(data){
		closeWaitBlock();
		if(data.status=="1"){
			parent.$.fn.ceebox.closebox();
			alert("Your message was sent successfully.");
		}else if(data.status=="-1"){
			$("body").html("The session time out.");
		}else if(data.status=="0"){
			$("body").html("Error");
		}
	},"json");
 

 

function openWaitBlock(message, timeout){
	if(!message){
		message = "<div style='font-size: 20px; float: right;'><img src='images/ajax-loader.gif'/></div>";
	}			
	$.blockUI({ css: { 
		            border: 'none', 
		            padding: '15px', 
		            backgroundColor: '', 
		            '-webkit-border-radius': '10px', 
		            '-moz-border-radius': '10px', 
		            opacity: .5, 
		            color: '#fff',
		            width: '15%'
	          	},
	          	message:message
	});
	if(timeout){
		setTimeout($.unblockUI, timeout); 
	}
}
 

find children

 

$("#myjobpost_status_list>li.wh>span")

copyTR.children().children("b.name").attr("onClick","checkCandidates("+list[i].rojid+");");
copyTR.find("b>img.isCheck").attr("src","images3/checked.png");
copyTR.find("b.name")
 

 

 

notice   jquery.notice.js

 

function notice(data){
	  if(data != null && data.length >0 ){
	   jQuery.noticeAdd({
		text: data
     });
	}
}
 

 

 

 

 

 

 

 

 

 

分享到:
评论

相关推荐

    jQuery中hasClass()方法用法实例

    主要介绍了jQuery中hasClass()方法用法,实例分析了hasClass()方法的功能、定义及验证匹配元素是否包含指定类的使用技巧,需要的朋友可以参考下

    jQuery源码解读之hasClass()方法分析

    主要介绍了jQuery源码解读之hasClass()方法,以注释形式较为详细的分析了hasClass()方法的实现技巧,具有一定参考借鉴价值,需要的朋友可以参考下

    jQuery 1.4.1 中文参考

    8.3.1 live(type, [data], fn) 127 8.3.2 die([type], [fn]) 130 8.4 事件切换 131 8.4.1 hover(over, out) 131 8.4.2 toggle(fn, fn2, [fn3, fn4, ...]) 131 8.5 事件 133 8.5.1 blur() 133 8.5.2 blur(fn) 133 ...

    JQuery新版中文手册

    JQuery开发手册 jQuery 核心函数 jQuery([sel,[context]]) jQuery(html,[ownerDoc]) jQuery(callback) jQuery.holdReady(hold)1.6+ jQuery 对象访问 each(callback) size() length selector context get...

    jQuery 1.5 API 中文版

    $.jQuery( selector [, context] ), .jQuery( element ), .jQuery( elementArray ), .jQuery( jQueryObject ), .jQuery( ) $.jQuery( html [, ownerDocument] ), .jQuery( html, props ) $.jQuery( fn ) jQuery ...

    Jquery学习手册

    也就是说,已经得到了一个jQuery对象,但是并不是想要的,那么可以通过一系列的跳转方法,比如parent()、next()、children()、find()等,或者过滤筛选的方法,比如eq()、filter()、not()等,来得到最终想要操作的...

    jquery1.11.0手册

    jQuery 1.11.0 速查表 核心 jQuery 核心函数 jQuery([sel,[context]]) jQuery(html,[ownerDoc])1.8* jQuery(callback) jQuery.holdReady(hold) jQuery 对象访问 each(callback) size() length selector ...

    jQuery详细教程

    jQuery详细教程,讲解很透彻, 一. jQuery 语法实例 $(this).hide() 演示 jQuery hide() 函数,隐藏当前的 HTML 元素。 $("#test").hide() 演示 jQuery hide() 函数,隐藏 id="test" 的元素。 $("p").hide() ...

    Jquery 1.3 简体中文手册

    insertBefore(content) 包裹 wrap(html) wrap(elem) wrapAll(html) wrapAll(elem) wrapInner(html) wrapInner(elem) 替换 replaceWith(content) replaceAll(selector) 删除 empty() remove([expr]) 复制 ...

    JQuery 1.3 中文参考手册

    insertBefore(content) 包裹 wrap(html) wrap(elem) wrapAll(html) wrapAll(elem) wrapInner(html) wrapInner(elem) 替换 replaceWith(content) replaceAll(selector) 删除 empty() remove([expr]) 复制 ...

    jquery 淘宝地址管理

    jquery 更换地址 代码贴上 $(function(){ $('#similar p').hover(function(){ $(this).addClass('bggray'); if(!($(this).hasClass('selected'))){ $(this).find('a').show(); } },function(){ $(this)....

    jQuery 1.6.3正式版发布

    #9630:修复foo.contents().hasClass()返回错误值的问题。 #9699:修复webkit内核浏览器中removeAttr('tyle')不能准确移除style属性的问题。 #9719:修复IE6中removeAttr('disabled')不能改变输入框颜色的问题。 #...

    jQuery移动端扁平化日历带事件代码.zip

    if(v.children().hasClass('sc-mark-show')){ var year = $('.sc-select-year').text(); var monthCH = $('.sc-select-month').text(); var day = v.children()[1].innerText; var month = SimpleCalendar....

    jQuery1.4及中文手册

    jQuery 是继 prototype 之后又一个优秀的 Javascript 框架。其宗旨是—写更少的代码,做更多的事情。它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不及的,它兼容 CSS3,还兼容各种浏览器(IE 6.0+, FF ...

Global site tag (gtag.js) - Google Analytics