2012-09-26 41 views
0

我正在嘗試整合jQuery shadowbox。所以我需要知道它是否可以用於td。根據shadowbox的文檔,必須爲鏈接添加rel=shadowboxjQuery的軌道應用程序中的陰影框

但在我的情況下,我有table而不是鏈接。所以當用戶點擊任何td的時候,shadowbox應該打開。它是否與shadowbox

回答

0

docs摘自:

Shadowbox.init({ 
    // skip the automatic setup again, we do this later manually 
    skipSetup: true 
}); 

window.onload = function() { 

    // set up all anchor elements with a "movie" class to work with Shadowbox 
    Shadowbox.setup("a.movie", { 
     gallery:   "My Movies", 
     autoplayMovies:  true 
    }); 

};​ 

在你的情況下,使用td.your_class代替a.movie

編輯: 我不知道應該是什麼內容,但你可以這樣做:

Shadowbox.init({ 
    skipSetup: true 
}); 

$('table td').click(function(e) { // when td is clicked.. 
    Shadowbox.open({ 
     content: '<p>Put your content here.</p>', 
     player: 'html', 
    title: 'My shadowbox' 
    });​ 
}); 

注意playercontent

+0

那麼我會爲圖庫選項提供哪些輸入?我基本需要的是在shadowbox中顯示一個表單。 – rubyist