我正在创建一个html5模板。我有一些插件。所以我创建了一个不同的javascipt文件来调用它们(只是为了更好地组织事物)。我不是一个javascript专业人士,所以我想我可能在js文件中有一些问题,因为一些插件在活动时不起作用(如Megafolio网格插件,GoUp插件)。所以,如果有人告诉我,如果我的js文件中有任何错误,那就太好了。这是:
<!--Image Grid-->
$(function() {
$( '#ri-grid' ).gridrotator( {
slideshow : false,
onhover : true,
rows : 3,
columns : 8,
maxStep : 2,
interval : 2000,
w1024 : {
rows : 3,
columns : 6
},
w768 : {
rows : 3,
columns : 5
},
w480 : {
rows : 3,
columns : 4
},
w320 : {
rows : 3,
columns : 4
},
w240 : {
rows : 3,
columns : 3
},
} );
});
<!--Owl Carouosel-->
$(document).ready(function(){
$(".custom1").owlCarousel({
autoplay: true,
autoplayTimeout: 4000,
autoplayHoverPause: true,
loop:true,
margin:10,
responsiveClass:true,
responsive:{
0:{
items:2,
nav:true
},
600:{
items:3,
nav:false
},
1000:{
items:4,
nav:true
}
}
});
});
<!--Owl Carouosel 2-->
$(document).ready(function(){
$(".custom2").owlCarousel({
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: true,
loop:true,
responsiveClass:true,
/*animateOut: 'slideOutDown',*/
animateOut: 'fadeOutDown',
animateIn: 'fadeInUp',
items: 1,
margin: 30,
stagePadding: 30,
smartSpeed: 450
});
});
<!--Skill Barl-->
jQuery(document).ready(function(){
jQuery('.skillbar').each(function(){
jQuery(this).find('.skillbar-bar').animate({
width:jQuery(this).attr('data-percent')
},6000);
});
});
<!--Form Validation-->
$(function()
{
// Validation
$("#sky-form").validate(
{
// Rules for form validation
rules:
{
name:
{
required: true
},
email:
{
required: true,
email: true
},
message:
{
required: true,
minlength: 10
}
},
// Messages for form validation
messages:
{
name:
{
required: 'Please enter your name',
},
email:
{
required: 'Please enter your email address',
email: 'Please enter a VALID email address'
},
message:
{
required: 'Please enter your message'
}
},
// Ajax form submition
submitHandler: function(form)
{
$(form).ajaxSubmit(
{
success: function()
{
$("#sky-form").addClass('submited');
}
});
},
// Do not change code below
errorPlacement: function(error, element)
{
error.insertAfter(element.parent());
}
});
});
答案 0 :(得分:0)
检查您是否拥有正确的导入订单:
<script src="YOUR_JQUERY_VERSION_.js"></script>
<script src="JQUERY_UI_VERSION.js"></script> // OPTIONAL
<script src="OTHER_JQUERY_LIBRARIES.js"></script> //OPTIONAL
<script src="YOUR_OWN_LIBRARY.js"></script>