mark_nsx Posted January 2, 2007 Share Posted January 2, 2007 Hi there! I would like to know how to go about blacking out/disabling the whole windowwhen a user triggers an onClick event just like in thefind.com (click Login or Add a Productat the bottom of the page). Any ideas guys? Cheers!Here's the URL: http://thefind.com/main/query.php?qS=usr&query=nike Quote Link to comment Share on other sites More sharing options...
fenway Posted January 3, 2007 Share Posted January 3, 2007 It's not disabled, it's just an opacity... Quote Link to comment Share on other sites More sharing options...
mark_nsx Posted January 8, 2007 Author Share Posted January 8, 2007 I got the opacity sorted out and disabling of the scrollbars (overflow: hidden), but how do they manage to show the login popup? I have tried appending my form's code in the body innerHTML but I end up with the form having blacked out as well. Thanks for the help! Cheers =) Quote Link to comment Share on other sites More sharing options...
fenway Posted January 8, 2007 Share Posted January 8, 2007 I assumed it was a modal dialog... Quote Link to comment Share on other sites More sharing options...
mark_nsx Posted January 9, 2007 Author Share Posted January 9, 2007 yes it is..i figured out how to show the dialogs using AJAX..now I need to work outhow to disable the widgets behind the opaque layer.. Quote Link to comment Share on other sites More sharing options...
Zeon Posted January 9, 2007 Share Posted January 9, 2007 i would do it like this:first the css:[code]body, html{ width:100%; height:100%; overflow:hidden;}div#black_out{ position:absolute; top:0; left:0; width:100%; height:100%; background:#888; opacity:0.5; filer:alpha(opacity=50); -moz-opacity:0.5;}[/code]js:[code]function blackOut(){ var div = document.createElement('div') div.id = 'black_out' // or div.setAttribute('id','black_out') document.body.appendChild(div)}function hideBlackOut(){ var div if (div = document.getElementById('black_out') document.body.removeChild(div)}function showDialog(){ blackOut() // code for dialog... return false}function hideDialog(){ hideBlackOut() // -- code for hiding the dialog}[/code]html:[code]<a href="javascript:showDialog()">show dialog</a><!-- OR --><a href="#" onclick="showDialog()">show dialog [onclick]</a>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.