开发者

Creating 300 instances of blockui

I am currently trying to create 300 instances of blockui

Currently this can only be done by copy and paste:

For example:

 <script type="text/javascript"> 
    $(document).ready(function() { 

        $('#t1').click(function() { 
            $.blockUI({ message: $('#q1'), css: { width: '1024px' } }); 
        }); 

        $('#yes1').click(function() { 
            // update the block message 
            $.blockUI({ message: "<h1>Remote call in progress...</h1>" }); 

            $.ajax({ 
                url: 'wait.php', 
                cache: false, 
                complete: function() { 
                    // unblock when remote call returns 
                    $.unblockUI(); 
                } 
            }); 
        }); 

        $('#no1').click(function() { 
            $.unblockUI(); 
            return false; 
        }); 

    }); 
</script> 

<script type="text/javascript"> 
    $(document).ready(function() { 

        $('#t2').click(function() { 
            $.blockUI({ message: $('#q2'), css: { width: '1024px' } }); 
        }); 

        $('#yes2').click(function() { 
            // update the block message 
            $.blockUI({ message: "<h1>Remote call in progress...</h1>" }); 

            $.ajax({ 
                url: 'wait.php', 
                cache: false, 
                complete: function() { 
                    // unblock when remote call returns 
                    $.unblockUI(); 
                } 
            }); 
        }); 

        $('#no2').click(function() { 
            $.unblockUI(); 
            return false; 
    开发者_如何学运维    }); 

    }); 

</script> 

Can anyone suggest a quicker way?


http://php.net/manual/en/control-structures.for.php

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜