Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我想使用div作为twitter引导模式链接_Javascript_Twitter_Modal Dialog - Fatal编程技术网

Javascript 我想使用div作为twitter引导模式链接

Javascript 我想使用div作为twitter引导模式链接,javascript,twitter,modal-dialog,Javascript,Twitter,Modal Dialog,你能帮我吗?我想使用div作为twitter引导模式链接。当我点击一个div时,它将调用一个modal。可能吗?如果可能的话,请给我指路。我认为这是可能的,但我不知道怎么做。请帮助我。使用$modal.modal('show') HTML: <div class="my-div"></div> <div class="modal hide fade"> <div class="modal-header"> <button typ

你能帮我吗?我想使用div作为twitter引导模式链接。当我点击一个div时,它将调用一个modal。可能吗?如果可能的话,请给我指路。我认为这是可能的,但我不知道怎么做。请帮助我。

使用
$modal.modal('show')onclick
事件处理程序中的code>

HTML:

<div class="my-div"></div>

<div class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Modal header</h3>
  </div>
  <div class="modal-body">
    <p>One fine body…</p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary">Save changes</a>
  </div>
</div>
var $modal = $('.modal').modal({
    show: false
});
$('.my-div').on('click', function() {
    $modal.modal('show');
});
使用
$modal.modal('show')onclick
事件处理程序中的code>

HTML:

<div class="my-div"></div>

<div class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>Modal header</h3>
  </div>
  <div class="modal-body">
    <p>One fine body…</p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">Close</a>
    <a href="#" class="btn btn-primary">Save changes</a>
  </div>
</div>
var $modal = $('.modal').modal({
    show: false
});
$('.my-div').on('click', function() {
    $modal.modal('show');
});

这里是

您的HTML:

<div data-toggle="modal" href="#example">Launch modal</div>

<div id="example" class="modal hide fade in" style="display: none;">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">×</a>
        <h3>This is a Modal Heading</h3>
    </div>
    <div class="modal-body">
        <h4>Text in a modal</h4>
        <p>You can add some text here.</p>              
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-success">Call to action</a>
        <a href="#" class="btn" data-dismiss="modal">Close</a>
    </div>
</div>
这是

您的HTML:

<div data-toggle="modal" href="#example">Launch modal</div>

<div id="example" class="modal hide fade in" style="display: none;">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">×</a>
        <h3>This is a Modal Heading</h3>
    </div>
    <div class="modal-body">
        <h4>Text in a modal</h4>
        <p>You can add some text here.</p>              
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-success">Call to action</a>
        <a href="#" class="btn" data-dismiss="modal">Close</a>
    </div>
</div>

所以@Taslim,一般来说,当一个答案有帮助时,你会投票支持它。您还可以将最适合您的选项标记为“已接受”。您这样做,人们将更有可能回答您将来可能提出的任何问题。@Taslim-要投票选出有用的答案,请单击每个答案开头数字0上方的向上箭头。要将一个特定答案标记为“已接受”,请单击0下方向下箭头下方的复选标记符号。一般来说,这会鼓励用户回答你的问题,因为他们知道他们可能会从你那里获得选票。是的,GitHub上不再有CSS文件。所以@Taslim,通常当答案有帮助时,你会投票支持它。您还可以将最适合您的选项标记为“已接受”。您这样做,人们将更有可能回答您将来可能提出的任何问题。@Taslim-要投票选出有用的答案,请单击每个答案开头数字0上方的向上箭头。要将一个特定答案标记为“已接受”,请单击0下方向下箭头下方的复选标记符号。一般来说,这将鼓励用户回答您的问题,因为他们知道他们可能会从您那里获得选票。是的,GitHub中不再有CSS文件。