我在my next wordpress project中使用背景幻燈片。如何在JS文件中插入Php變量
我正在使用選項面板的redux框架。
我想使用JQuery UI微調器示例1來控制滑塊的速度。
如何將php變量插入到滑塊的js文件中?
下面是代碼:
var cbpBGSlideshow = (function() {
var $slideshow = $('#cbp-bislideshow'),
$items = $slideshow.children('li'),
itemsCount = $items.length,
$controls = $('#cbp-bicontrols'),
navigation = {
$navPrev : $controls.find('span.cbp-biprev'),
$navNext : $controls.find('span.cbp-binext'),
$navPlayPause : $controls.find('span.cbp-bipause')
},
// current item´s index
current = 0,
// timeout
slideshowtime,
// true if the slideshow is active
isSlideshowActive = true,
// it takes 3.5 seconds to change the background image
interval = 3500;
}
我想要做這樣的事情
interval= redux variable name
感謝