2010-09-03 72 views
0

我用這個函數內部,從javascript函數啓動jQuery的facebox?

document.getElementById("DeleteConfirmationdiv").style.display = 'block'; 

現在我想用jQuery Facebox插件推出這個DeleteConfirmationdiv。可能嗎?

到目前爲止,我一直在使用facebox這樣,

$(document).ready(function($) { 
    $.facebox.settings.opacity = 0.2; 
    $('a[rel*=facebox]').facebox(); 
}); 

和我的網頁有這個,

<a id="signin" href="#signindiv" rel="facebox"> 
    <img alt="" src="Css/images/Sign in.png" height="19" width="59" /> 
</a> 

我試過,但它不工作,

function showDisplaydiv() { 
    $.facebox.settings.opacity = 0.2; 
    $('#ConfirmationPanel').facebox(); 
    //document.getElementById("ConfirmationPanel").style.display = 'block'; 
    document.getElementById("datatable").style.display = 'block'; 
    document.getElementById("ImageButtonDiv").style.display = 'block'; 
    document.getElementById("adddiv").style.display = 'none'; 
    return false; 
} 

我把這個功能稱爲按鈕,

<asp:Button ID="Delete" runat="server" CssClass="deletebuttons" 
OnClientClick="javascript:return(Deleteyuitable()&&showDisplaydiv(''));" 
onfocus="this.blur();" Text="" /> 

回答

1

我已經得到它的工作,

$(function(){ 
    $.facebox({ div: '#box' }); 
}); 

只是做這個,

function showDisplaydiv() { 
    $.facebox.settings.opacity = 0.2; 
    $.facebox({ div: '#ConfirmationPanel' }); 
    //document.getElementById("ConfirmationPanel").style.display = 'block'; 
    document.getElementById("datatable").style.display = 'block'; 
    document.getElementById("ImageButtonDiv").style.display = 'block'; 
    document.getElementById("adddiv").style.display = 'none'; 
    return false; 
}