我正在将一个基本站点与 Galleria 库、隐藏/显示和验证表单放在一起。当我加载 Galleria 脚本时,对我的基本反馈表单的验证失败。
当我还将 Galleria 脚本加载到页面中时,什么原因可能会阻止 JQuery 验证脚本运行?验证在 Galleria 未加载时工作正常,但在加载时失败。现场直播:http: //lucidnetdesigns.com/invidia/这是当前的导入和脚本:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/jquery.validate.js"></script>
<script type="text/javascript" src="galleria/galleria-1.2.7.min.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/latest/ui/effects.core.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/latest/ui/effects.slide.js"></script>
<script type="text/javascript">
Galleria.loadTheme('galleria/themes/twelve/galleria.twelve.min.js');
Galleria.run('#galleria', {
fullscreenCrop: 'false',
autoplay: 3000,
imageCrop: true
});
$(document).ready(function() {
$('#content_salon').hide();
$('a#show_content_salon').click(function () {
$('#content_salon').slideToggle('slow');
return false;
});
});
$(document).ready(function () {
$('#content_services').hide();
$('a#show_content_services').click(function () {
$('#content_services').slideToggle('slow');
return false;
});
});
$(document).ready(function () {
$('#content_contactus').ahow();
$('a#show_content_contactus').click(function () {
$('#content_contactus').slideToggle('slow');
return false;
});
});
$(document).ready(function(){
$("#form1").validate({
rules:
{
email1: "required",
email2: {
equalTo: "#email1" },
phone: {
minlength: 10,
maxlength: 10
},
fullname: {
minlength: 2
},
},
messages: {
name: "Please enter your full name.",
email1: "Please enter a valid email.",
phone: "Phone number must be 10 characters (include area code).",
},
errorPlacement: function(error, element) {
error.appendTo( element.parent() );
}
});
});
</script>