dthtvk3666
dthtvk3666
2018-04-20 08:03
浏览 208

jquery.js和bootstrap.js冲突

when jquery.js and bootstrap.js active, button form action can't run. But when jquery.js command, button signin (tg-btnsignin) can't run.

this is script code:

<script src="<?php echo base_url('/assets/js/bootstrap.min.js'); ?>"></script>
<script src="<?php echo base_url('/assets/js/vendor/jquery-library.js'); ?>"></script>

this is my form code:

<form class="tg-formtheme tg-formtrip" 
        method = "GET" 
        action = "<?php echo site_url('Home/search'); ?>" >

this is my signin code:

<div class="tg-userbox">
<a id="tg-btnsignin" class="tg-btn" href="#tg-loginsingup">
    <span>sign in</span>
</a>

图片转代码服务由CSDN问答提供 功能建议

当jquery.js和bootstrap.js处于活动状态时,按钮表单操作无法运行。 但是当jquery.js命令时,按钮signin( tg-btnsignin )无法运行。

这是脚本代码:

 &lt; script src =“&lt;?php echo base_url('/ assets / js / bootstrap.min.js');?&gt;”&gt;&lt; / script&gt; 
&lt; script src =  “&lt;?php echo base_url('/ assets / js / vendor / jquery-library.js');?&gt;”&gt;&lt; / script&gt; 
   
 
 < 这是我的表单代码: 
 
 
 &lt; form class =“tg-formtheme tg-formtrip”
 method =“GET”
 action =“&lt;?  php echo site_url('Home / search');?&gt;“  &gt; 
   
 
 

这是我的登录代码:

 &lt; div class =“tg-userbox”&gt  ; 
&lt; a id =“tg-btnsignin”class =“tg-btn”href =“#tg-loginsingup”&gt; 
&lt; span&gt;登录&lt; / span&gt; 
&lt; / a&gt; 
 <  / code>  
 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongyu9850
    dongyu9850 2018-04-20 08:06
    已采纳

    Put the jQuery before bootstrap.

    <script src="<?php echo base_url('/assets/js/vendor/jquery-library.js');?>"></script>
    <script src="<?php echo base_url('/assets/js/bootstrap.min.js');?>"></script>
    
    点赞 评论

相关推荐