2011-12-05 153 views
0

我希望能够访问网站上每个其他页面的菜单页面上的动态内容,但使用下面的代码时,它甚至不会在点击时离开当前页面。我希望它显示被点击的确切内容。要显示的内容都在菜单页上。网址是http://www.pizza.siteripe.com/menu.html我无法确定问题所在。从另一个页面访问动态内容切换器

<script type='text/javascript'> 
$(document).ready(function() { 
    jcps.fader(300, '#switcher-panel'); 
}); 


</script> 
+0

你的问题是什么?你能描述一下发生了什么,应该发生什么? – Blender

+0

当侧栏上的菜单中的任何链接被点击(来自其他页面)时,它应该带您进入菜单页面,同时显示被点击的确切内容。 –

回答

0

你需要以某种方式重定向和展示的内容:

$('#introright a').click(function() { 
    if (window.location.href != 'http://www.pizza.siteripe.com/menu.html') { 
    window.location.href = 'http://www.pizza.siteripe.com/menu.html#' + $(this).prop('id'); 
    } 
}); 

然后menu.html页:

$(document).ready(function() { 
    if (window.location.hash) { 
    $(window.location.hash).click(); 
    } 
}); 

我写这从内存中,因此不要指望它上班。但你可能会很幸运。

相关问题