【问题标题】:slider not working滑块不工作
【发布时间】:2012-12-11 00:40:30
【问题描述】:

你们能告诉我为什么我的滑块不工作吗 我已经在 js fiddle 中包含了所有资源,然后它也不起作用 在下面提供小提琴链接

http://jsfiddle.net/YakV7/2/

实际演示

http://tympanus.net/Development/ParallaxContentSlider/

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery.cslider.js"></script>
        <script type="text/javascript">
            $(function() {

                $('#da-slider').cslider();

            });
        </script> 

【问题讨论】:

  • 您没有正确包含jquery.cslider.js。尝试使用绝对路径而不是相对路径。当 javascript 不起作用时,还要检查您的 javascript 错误。
  • 你能告诉我应该把什么路径给男性它工作
  • 这里一切正常jsfiddle.net/YakV7/6
  • @user1914176 请参阅我的回答中的工作小提琴。 :) 我的意思是一切,包括图片! :)
  • 感谢您的回复,我正在尝试实现类似于 ibm 的 css3 滑块动画,但我不想让动画实现类似于 ibm ibm.com/us/en

标签: jquery-ui jquery jquery-plugins jquery-selectors


【解决方案1】:

这些行是什么意思?

<link rel="stylesheet" type="text/css" href="css/demo.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/modernizr.custom.28468.js"></script>
<script type="text/javascript" src="js/jquery.cslider.js"></script>

改成实际路径。

<link rel="stylesheet" type="text/css" href="http://tympanus.net/Development/ParallaxContentSlider/css/demo.css">
<link rel="stylesheet" type="text/css" href="http://tympanus.net/Development/ParallaxContentSlider/css/style.css">
<script type="text/javascript" src="http://tympanus.net/Development/ParallaxContentSlider/js/modernizr.custom.28468.js"></script>
<script type="text/javascript" src="http://tympanus.net/Development/ParallaxContentSlider/js/jquery.cslider.js"></script>

或添加:

<base href="http://tympanus.net/Development/ParallaxContentSlider/" />

同样的工作小提琴:http://jsfiddle.net/YakV7/7/

【讨论】:

  • 在您的&lt;head&gt; 中使用&lt;base href="http://tympanus.net/Development/ParallaxContentSlider/" /&gt;。我不会推荐它,并且在您的站点中托管文件会更好。路径是http://tympanus.net/Development/ParallaxContentSlider/。
  • 感谢您的回复,我正在尝试实现类似于 ibm 的 css3 滑块动画,但我不希望在动画中实现类似于 ibm ibm.com/us/en
  • @user1914176 应该是 400 毫秒或在 css 中 0.4s
  • .da-slide-fromright .da-slide-fromleft .da-slide-toright .da-slide-toleft 这是类
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-11-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多