3
我正在向我的網站添加一個lightbox腳本,這是因爲我在我的網站開始時使用了本教程http://tutorialzine.com/2010/11/apple-style-splash-screen-jquery/中的代碼,所以它在進入網站時加載了動畫,但是`兩個jQuery腳本衝突
$(document).ready(function(){
// Calling our splashScreen plugin and
// passing an array with images to be shown
$('#promoIMG').splashScreen({
textLayers : [
'img/thinner.png',
'img/more_elegant.png',
'img/our_new.png'
]
});
});
上面的代碼抵消了什麼,我從收藏夾腳本中使用這裏找到:http://leandrovieira.com/projects/jquery/lightbox/#
如何獲得兩個一起工作?
我將它們添加到我的頭,如下所示(這是WordPress的範圍內):
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/Javascript/jquery.splashscreen.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/Javascript/script.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/Javascript/lightbox/js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/Javascript/lightbox/css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
$(function() {
$('#sidebar-menu a').lightBox();
});
</script>
任何建議都行!
什麼都沒有發生,我將第一個代碼添加到第34 - 38行之間的splash.js文件中,但仍然沒有任何內容,並將底部添加到我的script.js文件中?我錯過了什麼? – Beto
然後你需要做一些調試。我更新了我的答案。 –
我試過在上面運行你的代碼,但我不擅長js/jquery,也不知道如何檢查錯誤。在Chrome或Safari瀏覽器中輸入: – Beto