views:

146

answers:

1

Hello, I am trying to use BlockUI with jQuery's hide, however, not everything's going to plan.

Currently, upon script load, the said div (radiodj) hides itself. When user clicks on a button, the div shows up. Now, here's the problem. When user clicks on a link inside the div, the div hides away again, but the link action is performed, i.e div is "blocked"

Here's the javascript, and respective HTML for it:

$(document).ready(function(){
$('#radiodj').hide();

$("#apply-radiodj").click(function () {
 $("#radiodj").toggle("slow");
});
$('#radiodj').click(function() {
 $('#radiodj').hide('slow');
 $('div.radiodj').unblock(); 
 });
$('#radiodjcancel').click(function() {
 $('#radiodj').block({ 
        message: '<h1>Processing</h1>', 
        css: { border: '3px solid #a00' } 
        }); 
});
$('#radiodjsave').click(function() { 
 $('#radiodj').block({ 
        message: '<h1>Processing</h1>', 
        css: { border: '3px solid #a00' } 
        }); 
    });

  });

and HTML

 Apply 
<div id="radiodj">
  <form action="#" method="post" id="radiodjform">
   <fieldset class="fieldset">
    <legend>Apply for position</legend>
    <div class="errmsg" align="center"><strong>Error 102:</strong> this form is not yet functional, don't apply!<br />
    </div>
    <div id="radiodjok">
     <p>
     <a id="radiodjsave">Save</a> or <a href="#" id="radiodjcancel">Cancel</a></p>
    </div>
   </fieldset>
  </form>
</div>
A: 
$('#radiodj').click(function()  {        
  $('#radiodj').hide('slow');        
  $('div.radiodj').unblock();         
});

I wonder what that's doing there :/

Bad me!

Shamil