我的 WordPress 主页上循环插件的暂停/播放按钮
我尝试在我的首页滑块(它使用循环插件)中添加手动“暂停”和“播放”按钮,这就是我正在使用的。我尝试参考 Cycle 插件示例来让我的工作正常工作,但我缺乏 java / jquery 知识让我有点困惑。
这是我想要实现的循环插件的链接: HTTP->> jquery.malsup.com/cycle/pause.html(垃圾邮件过滤由于某种原因不允许我发布此 URL..???) - 我没有使用输入按钮,而是使用具有以下 ID 的 div:
<a href="#" id="slider_pause"></a>
<a href="#" id="slider_resume"></a>
据我了解,它不像添加“下一个”和“上一个”按钮那么容易,因为循环插件不排除 div ID 作为选项用于前进和暂停幻灯片。
对于暂停按钮,相关的 javascript 如下(取自 Cycle-plugin 网站):
$('#pauseButton').click(function() {
$('#s1').cycle('pause');
});
显然我会将 #pauseButton 更改为 #slider_pause。我会将 #s1 更改为什么?
我目前使用的 WordPress 具有以下设置以使循环插件正常工作。此时我应该在哪里添加它?
这是集成了cycle=plugin的当前wordpress主题文件代码:
<?php
$jcycle_timeout = get_option('ka_jcycle_timeout');
$jcycle_pause_hover = get_option('ka_jcycle_pause_hover');
if ($jcycle_pause_hover == "true") {$jcycle_pause_hover_results = '1';}
else {$jcycle_pause_hover_results = '0';}
echo '<script type="text/javascript">
//<![CDATA[
TTjquery(window).load(function() {
TTjquery(\'.home-banner-wrap ul\').css("background-image", "none");
TTjquery(\'.jqslider\').css("display", "block");
TTjquery(\'.big-banner #main .main-area\').css("padding-top", "16px");
TTjquery(\'.home-banner-wrap ul\').after(\'<div class="jquery-pager">
</div>\').cycle({
fx: \'fade\',
timeout: '.$jcycle_timeout.',
height: \'auto\',
pause: '.$jcycle_pause_hover_results.',
pager: \'.jquery-pager\',
cleartypeNoBg: true,
prev: \'#prev1\',
next: \'#next1\'
});
});
//]]>
</script>';
?>
不幸的是,它目前在本地主机上开发,我没有能力将其上传到ATM
I've tried adding a manual "Pause" and "play" button to my frontpage slider (It uses cycle-plugin) is what I'm using. I've tried refering to the cycle plugin examples to get mine working, but my lack of java / jquery knowledge has me slightly puzzled.
Here is the link to the cycle plugin on what I want to achieve:
HTTP ->> jquery.malsup.com/cycle/pause.html (spam filtering won't let me post this URL for some reason..????)
- Instead of using an input button, I am using a div with ID's of the following:
<a href="#" id="slider_pause"></a>
<a href="#" id="slider_resume"></a>
From what I understands its not as easy as adding "Next" and "prev" buttons as the cycle plugin doesn't except div ID's as an option for advancing and pausing the slideshow.
For the pause button the javascript in question is as follows (taken from the cycle-plugin website):
$('#pauseButton').click(function() {
$('#s1').cycle('pause');
});
Obviously I would change #pauseButton to #slider_pause. What would I change #s1 to?
The wordpress them I am using currently has the following setup to make the cycle-plugin work. Where would I add it at this point?
Here is the currenty wordpress theme file code that integrates the cycle=plugin:
<?php
$jcycle_timeout = get_option('ka_jcycle_timeout');
$jcycle_pause_hover = get_option('ka_jcycle_pause_hover');
if ($jcycle_pause_hover == "true") {$jcycle_pause_hover_results = '1';}
else {$jcycle_pause_hover_results = '0';}
echo '<script type="text/javascript">
//<![CDATA[
TTjquery(window).load(function() {
TTjquery(\'.home-banner-wrap ul\').css("background-image", "none");
TTjquery(\'.jqslider\').css("display", "block");
TTjquery(\'.big-banner #main .main-area\').css("padding-top", "16px");
TTjquery(\'.home-banner-wrap ul\').after(\'<div class="jquery-pager">
</div>\').cycle({
fx: \'fade\',
timeout: '.$jcycle_timeout.',
height: \'auto\',
pause: '.$jcycle_pause_hover_results.',
pager: \'.jquery-pager\',
cleartypeNoBg: true,
prev: \'#prev1\',
next: \'#next1\'
});
});
//]]>
</script>';
?>
Unfortunately its on a localhost development at the moment and I don't have the ability to upload it ATM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
#s1 它是包含应该循环的图像的元素,因此如果将其命名为 #s1,它应该保留 #s1
#s1 it is element that contains images that should be cycled so if you name it as #s1 it should stay #s1