jQuery BlockUI Plugin Demo 4(Element Blocking Examples)

陶永望
2023-12-01

Element Blocking Examples

This page demonstrates how to block selected elements on the page rather than the entire page. The buttons below will block/unblock access to the bordered area beneath them.

  

<input id="blockButton" type="submit" value="Block">
<input id="blockButton2" type="submit" value="Block with Message">
<input id="unblockButton" type="submit" value="Unblock">

 

This text will not be blocked.  Test link - click me!

The following code is used on this page:

<script type="text/javascript"> 
    $(document).ready(function() { 
 
        $('#blockButton').click(function() { 
            $('div.test').block({ message: null }); 
        }); 
 
        $('#blockButton2').click(function() { 
            $('div.test').block({ 
                message: '<h1>Processing</h1>', 
                css: { border: '3px solid #a00' } 
            }); 
        }); 
 
        $('#unblockButton').click(function() { 
            $('div.test').unblock(); 
        }); 
 
        $('a.test').click(function() { 
            alert('link clicked'); 
            return false; 
        }); 
    }); 
</script>

 参考:http://malsup.com/jquery/block/#overview

转载于:https://www.cnblogs.com/wolfocme110/p/4267730.html

 类似资料:

相关阅读

相关文章

相关问答