Simple Modal issues - Multiples, Disappearing Content

后端 未结 3 1414
既然无缘
既然无缘 2021-01-27 15:55

I\'m a jQuery newbie and have rigged Simple Modal to allow me to have more than one modal on a page by doing this in my script:

$(\'input.basic, a.basic\').click(f

3条回答
  •  一整个雨季
    2021-01-27 16:32

    I would suggest something like:

    Links:

    link1
    link2
    link3
    

    Hidden content (via CSS or inline style)

    
    
    
    

    JavaScript:

    $(document).ready(function () {
          $('#basic-modal input.basic, #basic-modal a.basic').click(function (e) {
                  e.preventDefault();
                  var content = '#' + this.id + '-content';
                  $(content).modal();
          });
    });
    

    Something like that should do the trick.

提交回复
热议问题