我的每个页面上都隐藏了我的幻灯片,但是我想在主页上看到它如何使用jquery执行此操作?这是一个现场演示http://epecho.com/tst/index.html
答案 0 :(得分:1)
以下是显示/隐藏页面上幻灯片的JavaScript:
$(".toggleButton").click(function() {
$("div#sliderSection").slideToggle("slow");
$(".toggleButton").toggle();
});
使用 window.location.href (由Andreas建议)功能,您应该执行以下操作:
if(window.location.href==url){
$('div#sliderSection').slideToggle('slow');
$('.toggleButton').toggle();
}
我建议进行以下额外修改:
希望这有帮助。
鲍勃
答案 1 :(得分:0)
如何检查location.href
是否为主屏幕网址?
if ( location.href == "http://epecho.com/tst/index.html" ) {
$('SLIDE_DECK').show();
}
我不知道这是否只是你需要的?