jQuery¼¼Êõ

jQuery.validationEngine.jsѧϰ - ÎÞÂëµÛ(4)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-09-08 08:01 ÎÒÒªÆÀÂÛ( )

_showPrompt: function (field, promptText, type, ajaxed, options, ajaxform) { var prompt = methods._getPrompt(field); (ajaxform) prompt = false ; ($.trim(promptText)){ if (prompt)methods._updatePrompt

_showPrompt: function(field, promptText, type, ajaxed, options, ajaxform) { var prompt = methods._getPrompt(field); (ajaxform) prompt = false; ($.trim(promptText)){ if (prompt) methods._updatePrompt(field, prompt, promptText, type, ajaxed, options); else methods._buildPrompt(field, promptText, type, ajaxed, options); } }

¿´Ò»ÏÂ_buildPrompt·½·¨

_buildPrompt: function(field, promptText, type, ajaxed, options) { prompt = $('<div>'); prompt.addClass(methods._getClassName(field.attr("id")) + "formError"); // add a class name to identify the parent form of the prompt prompt.addClass("parentForm"+methods._getClassName(field.closest('form, .validationEngineContainer').attr("id"))); prompt.addClass("formError"); (type) { case "pass": prompt.addClass("greenPopup"); break; case "load": prompt.addClass("blackPopup"); break; default: } if (ajaxed) prompt.addClass("ajaxed"); promptContent = $('<div>').addClass("formErrorContent").html(promptText).appendTo(prompt);positionType=field.data("promptPosition") || options.promptPosition; (options.showArrow) { var arrow = $('<div>').addClass("formErrorArrow"); (typeof(positionType)=='string') { var pos=positionType.indexOf(":"); if(pos!=-1) positionType=positionType.substring(0,pos); } "bottomLeft": case "bottomRight": prompt.find(".formErrorContent").before(arrow); arrow.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>'); break; case "topLeft": case "topRight": arrow.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>'); prompt.append(arrow); break; } } (options.addPromptClass) prompt.addClass(options.addPromptClass); requiredOverride = field.attr('data-required-class'); if(requiredOverride !== undefined) { prompt.addClass(requiredOverride); } else { if(options.prettySelect) { if($('#' + field.attr('id')).next().is('select')) { var prettyOverrideClass = $('#' + field.attr('id').substr(options.usePrefix.length).substring(options.useSuffix.length)).attr('data-required-class'); if(prettyOverrideClass !== undefined) { prompt.addClass(prettyOverrideClass); } } } } prompt.css({ "opacity": 0 }); if(positionType === 'inline') { prompt.addClass("inline"); if(typeof field.attr('data-prompt-target') !== 'undefined' && $('#'+field.attr('data-prompt-target')).length > 0) { prompt.appendTo($('#'+field.attr('data-prompt-target'))); } else { field.after(prompt); } } else { field.before(prompt);//ÔÚ´¥·¢¿Ø¼þµÄÇ°Ãæ²åÈë } var pos = methods._calculatePosition(field, prompt, options); prompt.css({ 'position': positionType === 'inline' ? 'relative' : 'absolute', "top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize, "opacity": 0 }).data("callerField", field); if (options.autoHidePrompt) { setTimeout(function(){ prompt.animate({ "opacity": 0 },function(){ prompt.closest('.formErrorOuter').remove(); prompt.remove(); }); }, options.autoHideDelay); } return prompt.animate({ "opacity": 0.87 //¶¯»­Ð§¹û }); }

Éú³ÉµÄСÈý½ÇµÄʵÏÖ·½Ê½±È½ÏÌر𡣡£½«´íÎóÄÚÈÝ·ÅÈëdivÖУ¬½«Éú³Édiv²åÔÚ±»´¥·¢¿Ø¼þµÄÇ°Ã棬²¢ÇÒΪdiv¼ÓÉÏclass£¬ÎªÊ²Ã´¼Ó£¬ÔÚinit·½·¨ÖУ¬ÎÒÃÇÒѾ­ÎªÕâÀàclassÌí¼ÓÁËclickʼþ£¬¹¦ÄÜÊǵã»÷Äܹ»É¾³ýËüÃÇ¡£

ÒÔÉÏÍê³ÉÒ»±é¼òµ¥µÄÑéÖ¤¹ý³Ì¡£

ÁíÍ⣬Õâ¸ö²å¼þ»¹ÓÐÒ»¸öÇ¿´óµÄ¹¦ÄÜ£¬¾ÍÊÇÌṩµÄajaxÑéÖ¤¡£

"/>

ÒÔÉÏÊÇÒ³ÃæÐèÒªÌí¼ÓµÄ¶«Î÷£¬ÒòΪ¹ØÁªµ½ajaxUserCallPhp£¬ÎÒÃÇÐÞ¸ÄÒ»ÏÂjQuery.validationEngine-en.js£¬ÕÒµ½ajaxUserCallPhp

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • jQueryѧϰ½ø½×ƪ

    jQueryѧϰ½ø½×ƪ

    2017-09-08 08:01

  • jQueryѧϰ±Ê¼Ç8

    jQueryѧϰ±Ê¼Ç8

    2017-09-04 12:08

  • Óü¼Êõ¸Ä±äÃüÔË,JAVA\JAVAWEB\ANDROID\ÔÚÏßѧϰƽ̨

    Óü¼Êõ¸Ä±äÃüÔË,JAVA\JAVAWEB\ANDROID\ÔÚÏßѧϰƽ̨

    2017-09-03 15:00

  • jQueryѧϰ(Îå)

    jQueryѧϰ(Îå)

    2017-09-02 10:01

ÍøÓѵãÆÀ
ø