2014-04-28 25 views
0

我已经使用jQuery Scrollbox。它在当地工作良好,但不在生产中工作。脚本不工作jQuery滚动条

enter image description here

这里是我的代码的jQuery

$(function() { 
$('#demo').scrollbox({ 
linear: false, // Scroll method 
startDelay: 2, // Start delay (in seconds) 
delay: 2, // Delay after each scroll event (in seconds) 
step: 5,// Distance of each single step (in pixels) 
speed: 32, // Delay after each single step (in milliseconds) 
switchItems: 1, // Items to switch after each scroll event 
direction: 'scrollLeft', 
distance: 'auto', 
autoPlay: true, 
onMouseOverPause: true, 
paused: false, 
queue: null 
}); 

}); 

$(function() { 
$('#demo1').scrollbox({ 
linear: false, // Scroll method 
startDelay: 3, // Start delay (in seconds) 
delay: 2, // Delay after each scroll event (in seconds) 
step: 5,// Distance of each single step (in pixels) 
speed: 32, // Delay after each single step (in milliseconds) 
switchItems: 1, // Items to switch after each scroll event 
direction: 'scrollLeft', 
distance: 'auto', 
autoPlay: true, 
onMouseOverPause: true, 
paused: false, 
queue: null 
}); 
}); 

其完全卡住。如何解决这个问题?

+0

在实时环境中访问时检查控制台错误消息。 – abc

+0

其工作正常..没有错误 –

+1

我检查了您提供的链接,并查看错误消息的控制台。似乎没有jQuery的参考。仔细检查你的jQuery库。 – abc

回答

1

问题出在您的脚本上。看来你必须添加下面一行:

<script> 
    jQuery(document).ready(function(){ 
     $('.page_of_paginationpagination_count_ba').appendTo('#owner_block_submenu_tree'); 
    }); 
</script> 

您需要添加一个$作为函数参数:

<script> 
    jQuery(document).ready(function($){ 
     $('.page_of_paginationpagination_count_ba').appendTo('#owner_block_submenu_tree'); 
    }); 
</script> 

否则,浏览器不知道什么$是 - $是jQuery的,但你不定义是作为函数参数。添加这些或使用jQuery(...)而不是$(...)

<script> 
    jQuery(document).ready(function(){ 
     jQuery('.page_of_paginationpagination_count_ba').appendTo('#owner_block_submenu_tree'); 
    }); 
</script>