javascript - Bootstrap 3 Modal won't pop up when triggering from anchor tag - Stack Overflow

Looking at some video tutorials I follow what has been done but don't seem to get to modal of the

Looking at some video tutorials I follow what has been done but don't seem to get to modal of the register link to trigger.

Here is the link I want to trigger:

<li><a href="#register-modal" data-toggle="modal" data-target="#register-modal">Register</a></li>

Here is the modal that should be triggering

<!-- Register Modal -->
<div class="modal fade" id="#register-modal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h2>Register</h2>
            </div>
        </div>
    </div>
</div>

I assume that there should be jQuery to be implemented after looking at other answers but i do not see how e if the jQuery es from the bootstrap. The Bootstrap 3 documentation seems to do the same as I did

Looking at some video tutorials I follow what has been done but don't seem to get to modal of the register link to trigger.

Here is the link I want to trigger:

<li><a href="#register-modal" data-toggle="modal" data-target="#register-modal">Register</a></li>

Here is the modal that should be triggering

<!-- Register Modal -->
<div class="modal fade" id="#register-modal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h2>Register</h2>
            </div>
        </div>
    </div>
</div>

I assume that there should be jQuery to be implemented after looking at other answers but i do not see how e if the jQuery es from the bootstrap. The Bootstrap 3 documentation seems to do the same as I did http://getbootstrap./javascript/#modals-examples

Share Improve this question asked Mar 22, 2015 at 0:28 Beast_CodeBeast_Code 3,26714 gold badges44 silver badges54 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

The id attribute shouldn't have a hashtag.

Change

<div class="modal fade" id="#register-modal" role="dialog"></div>

to:

<div class="modal fade" id="register-modal" role="dialog"></div>

Working Example

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745204192a4616504.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信