-2
我正在創建一個html5模板。我有一些插件。所以我創建了一個不同的javascipt文件來調用它們(只是爲了更好地組織這些東西)。我不是JavaScript專業人員,所以我想我可能在該js文件中存在一些問題,因爲有些插件在處於活動狀態時不起作用(如Megafolio網格插件,GoUp插件)。所以如果有人告訴我,如果我的js文件中有任何錯誤,那就太好了。這就是:javascript定製文件不能正常工作
<!--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());
}
});
});
我打賭你在頁面包含jQuery庫不止一次 – charlietfl
沒有。我只包括一次。 –
沒有人幫忙,但給我負面評價。我犯了什麼錯誤嗎? –