2009-07-22 15 views
1

(拖板)如何獲得拖板和lightbox2在同一頁

(燈箱)

上一起工作這是我的頭:

<script type="text/javascript" src="<?php echo ROOT.'sources/js/jquery.js'; ?>"></script> 
<script type="text/javascript" src="<?php echo ROOT.'sources/js/contentSlider/jquery.cross-slide.js'; ?>"></script> 
<link rel="stylesheet" href="<?php echo ROOT.'sources/css/lightbox.css'; ?>" type="text/css" media="screen" /> 
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/prototype.js'; ?>"></script> 
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/scriptaculous.js?load=effects,builder'; ?>"></script> 
<script type="text/javascript" src="<?php echo ROOT.'sources/js/lightbox/lightbox.js'; ?>"></script> 

這是我的身體:

<script type="text/javascript"> 
$(function() { 
    $('#imgHold').crossSlide({ 
     sleep: 3, 
     fade: .5 
    }, [ 
     { src: 'images/featured/ftcont_img1.png' }, 
     { src: 'images/featured/ftcont_img2.png' }, 
     { src: 'images/featured/ftcont_img3.png' }, 
     { src: 'images/featured/ftcont_img4.png' } 
    ]); 
}); 
</script> 
<div id="ftIMG"><div id="imgHold">Loading...</div></div> 

我沒有在這個頁面上使用燈箱腳本的任何東西。但我希望保持在PHP中的腳本,所以在PHP中,我只需要調用1頭。 LightBox「手冊」說添加「initLightbox();到身體標記的onload屬性,所以我做了這些,沒有任何改變現在我還讀了關於(jQuery.no衝突)的其他地方,即時通訊想知道如果這將是繼續的方式。或者,如果有另一種方式來解決這個問題。

另外,如果我想在同一個頁面上使用(ThickBox3.1)與一切。是否有可能,以及如何?這樣做究竟

此外,關於不張貼起來爲鏈接對不起你們,顯然是新用戶不得發佈了超過1個鏈接

+2

jQuery,原型*和* scriptaculous?哎呀! – 2009-07-22 00:45:51

回答

0

試着改變你的代碼片段如下:

jQuery(function() { 
    jQuery('#imgHold').crossSlide({ 
     sleep: 3, 
     fade: .5 
    }, [ 
     { src: 'images/featured/ftcont_img1.png' }, 
     { src: 'images/featured/ftcont_img2.png' }, 
     { src: 'images/featured/ftcont_img3.png' }, 
     { src: 'images/featured/ftcont_img4.png' } 
    ]); 
}); 

只要在頁面上沒有其他衝突,這可能會起作用。

如何使用jQuery與其他庫如Prototype和Scriptaculous,你利用的在你的例子兩者參見docs.jquery.com this article

+0

謝謝! ,確切地說我正在尋找的東西。但是當我測試出燈箱腳本時,它不會加載任何功能按鈕(next,prev,close)。我不確定這是否是我的問題,我搞砸了鏈接,所以我會看看,但感謝幫助我使crossSlide工作。 – imHavoc 2009-07-22 11:29:00