javascript - 单击轮播按钮时重定向到另一个页面

标签 javascript html angularjs node.js

当我点击旋转木马左右按钮时,我总是被定向到另一个页面(登录页面)。我可以单击小按钮导航到其他幻灯片,但不能通过按钮导航。我不确定为什么会变成这样。

应用程序.js

        .state('home', {
    url: '/home',
    templateUrl: 'views/home.html',
    controller: 'HomeController'
    })

index.html

        <li>
          <a ui-sref="home" ui-sref-active="active">Home</a>
        </li>

home.html

    <section>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="/img/ibm.png" alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
    <div class="item">
      <img src="/img/ibm.png" alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
</section>

最佳答案

这通常发生在像这样在 Bootstrap 文件之后加载 JQuery 文件时

<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery-2.1.4.min.js"> </script>

它应该首先加载 JQuery,而不是像这样加载 Bootstrap。

<script src="/js/jquery-2.1.4.min.js"> </script>
<script src="/js/bootstrap.min.js"></script>

检查一下,如果不是这种情况,则必须进行更深入的研究。

你也可以在这里找到一些有用的答案

Carousel Slider redirects

关于javascript - 单击轮播按钮时重定向到另一个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37202591/

相关文章:

javascript - jQuery 的 HTML 结构附加数组

html - 无法设置具有绝对位置的div的背景颜色

javascript - 在 javascript 或 php 中创建重复数组的最有效(紧凑)方式?

html - IE10 中的 HTML <pre> 标签中的空行被删除

html - 如何在 asp .net 中调整屏幕后将标签放置在准确位置

javascript - 输入值在任意位置包含特定字符

javascript - 我想在 ng-disabled 中给出多个条件

javascript - 有 Angular 。如何将 json 响应转换为 jsonp 响应?

javascript - JSON结果值作为JavaScript/jQuery中的键

javascript - 打印数组中字符串对的所有可能组合