简体   繁体   English

jQuery验证引擎中的箭头

[英]Arrow in jQuery validation engine

In JQuery validation engine for the promptPositions bottomRight and bottomLeft the arrow points towards top and vice versa. 在JQuery验证引擎中,对于hintPositions bottomRight和bottomLeft,箭头指向top,反之亦然。 for centerRight Position I want to point the arrow towards the left side, and for centerLeft I want to point the arrow towards the right. 对于centerRight位置,我想将箭头指向左侧,对于centerLeft,我想将箭头指向右侧。

I worked on it. 我做了。 But, couldn't find a better solution. 但是,找不到更好的解决方案。

arrow.addClass("formErrorArrowBottom").html('<div class="line5"><!-- --></div>\n\
<div class="line6"><!-- --></div>\n\
<div class="line7"><!-- --></div>\n\
<div class="line8"><!-- --></div>\n\
<div class="line9"><!-- --></div>\n\
<div class="line6"><!-- --></div>\n\
<div class="line7"><!-- --></div>\n\
<div class="line8"><!-- --></div>\n\
<div class="line9"><!-- --></div>\n\
<div class="line10"><!-- --></div>');

I edited this in jquery.ValidateEngine.js. 我在jquery.ValidateEngine.js中进行了编辑。 But vain. 但徒劳。 Do anyone know the correct format to get the arrow on the right and left. 有谁知道正确的格式来获取左右箭头。

TIA TIA

Well I had the same problem, so I updated the CSS with: 好吧,我遇到了同样的问题,所以我用以下内容更新了CSS:

.formError .formErrorArrow .sideline12 {
    width: 1px;
    height: 15px;
    border: none;
    float: left;
}

.formError .formErrorArrow .sideline11 {
    width: 1px;
    height: 13px;
    border: none;
    float: left;
    margin-top: 1px;
}

.formError .formErrorArrow .sideline10 {
    width: 1px;
    height: 11px;
    border: none;
    float: left;
    margin-top: 2px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline9 {
    width: 1px;
    height: 9px;
    border: none;
    float: left;
    margin-top: 3px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline8 {
    width: 1px;
    height: 7px;
    border: none;
    float: left;
    margin-top: 4px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline6 {
    width: 1px;
    height: 5px;
    border: none;
    float: left;
    margin-top: 5px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline6 {
    width: 1px;
    height: 3px;
    border: none;
    float: left;
    margin-top: 6px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline5 {
    width: 1px;
    height: 1px;
    border: none;
    float: left;
    margin-top: 7px;
    border-top: solid 4px #fff;
    border-bottom: solid 4px #fff;
}

.formError .formErrorArrow .sideline4 {
    width: 1px;
    height: 7px;
    border: none;
    float: left;
    margin-top: 8px;
    background: #fff;
}

.formError .formErrorArrow .sideline3 {
    width: 1px;
    height: 5px;
    border: none;
    float: left;
    margin-top: 9px;
    background: #fff;
}

.formError .formErrorArrow .sideline2 {
    width: 1px;
    height: 3px;
    border: none;
    float: left;
    margin-top: 10px;
    background: #fff;
}

.formError .formErrorArrow .sideline1 {
    width: 1px;
    height: 1px;
    border: none;
    float: left;
    margin-top: 11px;
    background: #fff;
}

.formError .formErrorArrow .rightSideArrow {
    width: 14px;
    margin-left: 2px;
    margin-bottom: 7px;
    z-index: 5;
    background-color: transparent;
    border-color: transparent;
    vertical-align: middle;
}

And ths JS with: 和JS与:

case "centerRight":
    prompt.find(".formErrorContent").before(arrow);
    arrow.addClass("formErrorArrowRight").html('<div class="rightSideArrow"><div class="sideline1"><!-- --></div><div class="sideline2"><!-- --></div><div class="sideline3"><!-- --></div><div class="sideline4"><!-- --></div><div class="sideline5"><!-- --></div><div class="sideline6"><!-- --></div><div class="sideline7"><!-- --></div><div class="sideline8"><!-- --></div><div class="sideline9"><!-- --></div><div class="sideline10"><!-- --></div><div class="sideline11"><!-- --></div><div class="sideline12"><!-- --></div></div>');
break;

And HTML: 和HTML:

<script>
        jQuery(document).ready(function(){
            jQuery("#formID").validationEngine({ promptPosition: "centerRight" });
        });
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM