【问题标题】:Jquery Cycle / Open other page with other cycle plugin in a specific slideJquery Cycle / 在特定幻灯片中使用其他循环插件打开另一个页面
【发布时间】:2014-03-19 06:56:30
【问题描述】:

我想知道是否可以打开一个包含循环插件的新 page.html 并转到特定幻灯片。我的意思是,从 page1.htmlpage2.html 并在 slide 6 中启动插件。

我不太了解 JS,但这是我尝试使用的代码:

$(函数() { $('#cycle_images').cycle({ 超时:0, 速度:300, fx: 'scrollVert', 起始幻灯片:0 });

$('#button').click(function() {
window.location = 'page2.html' 
    $('#cycle_images').cycle(6); 
    return false;
});

});

非常感谢!!对不起我的英语不好:(

【问题讨论】:

  • 第一页 - window.location = 'page2.html#6' , 第二页写你的脚本 if url[somehting]#6 cycle go to 6
  • 嗨!非常感谢你的回答,我真的不知道如何把第二页的代码,像这样的东西?
  • 请查看我的回答

标签: jquery plugins cycle


【解决方案1】:

一页按钮id

<a href="pagetwo.html#2" target="_blank">Click me</a>

第二页[滑动页]

这样的代码[更新你的班级名称]

$(document).ready(function() {
   var urlNo = location.hash.split('#')[1]
   alert(urlNo);


    $('#banner').cycle({
        fx: 'fade',
        speed: 500,
        timeout: 5000,
        next: '#next',
        prev: '#previous',
        pause: 1
    });

    if ( urlNo == urlNo ){
    $('#banner').cycle(urlNo); 
    return false; 
    }


});

Demo link

【讨论】:

  • 再次感谢,我真的很感激,但我无法让它工作,我就是这样做的:PAGE1:点击我 PAGE2:
  • urlNo = location.hash.split('#')[4] 错了,用我的代码
  • 我用你的代码更新了,但是什么也没有,它总是把我送到第一张幻灯片:(
  • 您好!也许这可以帮助更好地解释我想要做什么:在这个链接中你可以看到一个小演示:contactarte.com.pe/test/page1.html我只是希望如果你点击例如slide4按钮,下一页将加载从slide4开始再次感谢! !
  • 脚本在哪里?在第二页?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-30
  • 1970-01-01
  • 2023-03-29
  • 1970-01-01
相关资源
最近更新 更多