Jquery常见功能使用。项目功能

1》整个构架:
JS最好使用对像形式:
例如:
object.cms={
tyle="<%=accountyle%>",
isPass=true,
checkIsEmpty:${"#BankCheck"},
function1: function(tmp){
....

},
function2: function(){
var slet=false;
if(this.checkIsEmpty=="Y"){
this.isPass=true
}
...
},
外面可以直接访问

if (typeof object == "undefined") object = {};
function callJs(){
  object.cms;

}  
}

2>>
查找父类的第一个CLASS. $(test).parents(".groupIndexForMember").filter(":first").find(".BeneficiaryDetails").hide();
<div class="groupIndexForMember">
......
<class="BeneficiaryDetails"/>
<input id="test"/>
</div>
<div class="groupIndexForMember">
......
<class="BeneficiaryDetails"/>
<input id="test2"/>
</div>
移除下位框中的值,添加一个新的值
dropDown.children().remove();
dropDown.append("<option value='Member/Director'>Member/Director</optoin>");
3>>
Jquery 打开一个新的窗口

         if ($("divResidentConfirm").length == 0){
            var divConfirm = $('<div id="divResidentConfirm" style="display:none;padding:10px 20px 0px 20px;"></div>');
            divConfirm.append('<p>You <span style="font-weight:bold;">must</span> be an Australian resident for tax purposes to open an account.</p>');
            divConfirm.append('<p>If you are an Australian resident for tax purposes, please return to the application and tick the Yes option. </p>');
            divConfirm.append('<p>If not, your application cannot proceed and will not be saved.</p>');
            $("body").append(divConfirm);                   
        }
      
        $("#divResidentConfirm").dialog({
            resizable: false,
            autoOpen: false,
            title: "Warning",
            closeText: "hide",
            width: 600,
            height: 210,
            modal: true,
            buttons: {
                "Return to Application": function() {
                    $( this ).dialog( "close" );
                },
                "Exit Application":function() {
                    $( this ).dialog( "close" );                   
                    window.parent.location.href =  "<%=request.getContextPath()%>";
                }
            }
        });

$("#divResidentConfirm").dialog("open");

打开一个新的窗口

5》
$("label.selection input").click(function(e){
            var el = $(e.target);
            if(el.attr("id").indexOf("Australia") != -1){
                el.parents(".row").next().show();
                el.parents(".row").next().next().hide();
            }else{
                el.parents(".row").next().hide();
                el.parents(".row").next().next().show();
            }
            if (el.attr("id").indexOf("AustralianResident") != -1 && el.attr("id").indexOf("_N") != -1){
                e.preventDefault();
                e.stopPropagation();
                $("#"+el.attr("id").replace("_N", "")).val("Y");
                $("#divResidentConfirm").dialog("open");
            }
           
         });
点击触发事件。
6》
            $(".b2b_tab4_otherAccount").click( function() { self.NominatedChoices_Change();}); 

            $("input[name='_OAL_1_Account']:radio").click( function() { self.BrokerAccountYesNo_Change();});


3>>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值