如何将Backstretch应用于body



我知道这是一个愚蠢的问题,但我不知道在Wordpress 上把这个代码放在哪里

/*
 * Here is an example of how to use Backstretch as a slideshow.
 * Just pass in an array of images, and optionally a duration and fade value.
 */
  // Duration is the amount of time in between slides,
  // and fade is value that determines how quickly the next image will fade in
  $.backstretch([
      "http://dl.dropbox.com/u/515046/www/outside.jpg"
    , "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
    , "http://dl.dropbox.com/u/515046/www/cheers.jpg"
  ], {duration: 3000, fade: 750});

这必须在脚本标记之间吗?或者在PHP代码中?

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
CODE
</script>

感谢

据我所知,backstretch会在目标div中添加一个div。此外,javascript是一种客户端语言。不需要在PHP中这样做。

简单的答案:在jquery中加载后,在客户端的两个脚本标记之间添加它。

最新更新