0

I have 10 dialog (from '#dialog1' to '#dialog10') When I run code, all dialog hide. But when i click '#list_vt"+i', "#dialog"+i is not open. Help me please (sorry, my english is not good) This is code:

$(function() {
  var i = 0;
  for(i = 1; i<=10; i++){
   $( "#dialog"+i ).dialog({
     autoOpen: false,
     show: {
    effect: "blind",
    duration: 500
     },
     hide: {
    effect: "explode",
    duration: 500
     },
     position: { 
    my: 'left top',
    at: 'left',
    of: $('#list_vt'+i)
     },
    width: 550 
   });
   $("#list_vt"+i).click(function() {
   $("#dialog"+i).dialog("open");
   })
  }
 });
  • did you try to explicitly write the name of the click function for the items like $("#list_vt1").click(... $("#list_vt2").click(... – Manuel Fuchs Apr 17 '16 at 10:22
  • when I write $("#list_vt"+1).click(function() { $("#dialog"+1).dialog("open"); }) – thanh48ckcd Apr 17 '16 at 11:04
  • when I write $("#list_vt1").click(function() { $("#dialog1").dialog("open"); }) dialog1 open. But i must write 10 paragraph, it is very long. i don't like it – thanh48ckcd Apr 17 '16 at 11:12

0 Answers0