【问题标题】:Redirected to another page when carousel button is clicked单击轮播按钮时重定向到另一个页面
【发布时间】:2016-09-09 05:07:02
【问题描述】:

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

app.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>

【问题讨论】:

  • 你在用routing吗?
  • 也分享路线代码;
  • 对不起,我没有为这个@itzmukeshy7 使用路由

标签: javascript html angularjs node.js


【解决方案1】:

这通常发生在您的 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-07
    • 2019-09-15
    • 1970-01-01
    • 1970-01-01
    • 2017-12-06
    • 1970-01-01
    • 2020-01-26
    • 1970-01-01
    相关资源
    最近更新 更多