开发者

Launch jquery facebox from a javascript function?

开发者 https://www.devze.com 2023-01-14 21:52 出处:网络
I use this inside a function, document.getElementById(\"DeleteConfirmationdiv\").style.display = \'block\';

I use this inside a function,

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

now I want to launch this DeleteConfirmationdiv using the jQuery Facebox plugin. Is it possible?

Thus far I've been using facebox like this,

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

and my page has this,

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

I tried this but it doesn't work,

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.getE开发者_JS百科lementById("adddiv").style.display = 'none';
    return false;
}

i call this function from a button,

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


I ve got it to work,

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

Just did this,

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号