【问题标题】:Soundcloud Stratus Player won't work?Soundcloud Stratus 播放器不起作用?
【发布时间】:2014-08-14 21:08:17
【问题描述】:

为什么我下面的代码无法运行并调出 Soundcloud Stratus 播放器? :( 显然我不太了解 Javascript。他们说这就是你所要做的,它会出现,但它不会出现。我已经尝试了很多东西!:(

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Blazing Audio | Buy Beats & Instrumentals For $1</title>
    <script type="text/javascript" src="http://stratus.sc/stratus.js"></script>
        <script src="http://code.jquery.com/jquery-1.7.2.js"></script>
 <!-- SCRIPTS -->
<script type="text/javascript">
  $(document).ready(function(){
    $('body').stratus({
      auto_play: true,
      download: false,
      links: 'https://soundcloud.com/blazingaudio/sets/rap-instrumentals',
      random: true
    animate: slide,
    buying: true,
    position: fixed,
    user: false,
    stats: false,
    align: bottom,
    });
  });
</script>
</head>
<body>
</body>
</html>

【问题讨论】:

  • 如果您使用的是插件,则必须在页面中包含外部 js
  • 哎呀,为什么它不在那里,我已经把它放了,但它仍然无法工作。不知道为什么我的很烂
  • 你能用你的新代码更新你的问题吗?
  • 好的,我刚刚更新了。
  • 看我的回答。应该能解决你的问题

标签: javascript jquery html


【解决方案1】:

按以下顺序添加外部js:

<script src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="http://stratus.sc/stratus.js"></script>

我更新了你的代码,它现在可以工作了:

See this fiddle

$(document).ready(function(){
$('body').stratus({
    auto_play: true,
    download: false,
    links: 'https://soundcloud.com/blazingaudio/sets/rap-instrumentals',
    random: true,
    buying: true,
    user: false,
    stats: false,
});
});

完整代码

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo by Zword</title>
  <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
  <script type='text/javascript' src="http://stratus.sc/stratus.js"></script>

<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
$(document).ready(function(){
$('body').stratus({
  auto_play: true,
  download: false,
  links: 'https://soundcloud.com/blazingaudio/sets/rap-instrumentals',
  random: true,
  buying: true,
  user: false,
 stats: false,
});
});
});//]]>  

</script>
</head>
<body>
</body>
</html>

【讨论】:

  • 不 :( 但感谢您提供的提示以供将来参考。
  • 你能把整个事情贴出来吗?它仍然不会出现在我看来,我做错了什么,(对不起)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-28
  • 1970-01-01
  • 1970-01-01
  • 2013-06-22
  • 1970-01-01
  • 2020-05-03
相关资源
最近更新 更多