Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- orig
- <script type="text/javascript">
- $(document).ready(function(){
- $('#sampletoggles li').each(function(index) {
- var key = index+1;
- console.log('sample' + key);
- $('#sample' + key).dialog({
- dialogClass: 'sample',
- autoOpen: false,
- width: 640,
- height: 700,
- modal: true,
- closeOnEscape: true,
- close: function(event, ui) { return false; }
- });
- $('#sample' + key + 'toggle').click(function(){
- $('#sample' + key).dialog('open');
- return false;
- });
- });
- });
- </script>
- proposed
- <script type="text/javascript">
- $(document).ready(function(){
- $('#sampletoggles li').each(function(index) {
- var key = index+1;
- console.log('sample' + key);
- var dialog = $('#sample' + key).dialog({
- dialogClass: 'sample',
- autoOpen: false,
- width: 640,
- height: 700,
- modal: true,
- closeOnEscape: true,
- close: function(event, ui) { return false; }
- });
- $(this).click(function(){
- dialog.dialog('open');
- return false;
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement