-1

As you will probably tell from my question I am a bit of newbie at this. Anyway, I have been racking my brain on this for days and I cannot find a solution anywhere.

What I am trying to do is create a php page with html text but I want the page to contain a section that displays different text based on a click from menu list.

I know it is possible because I have seen it elsewhere but I cannot seem to figure it our. I would be grateful for any assistance I can get.

Cheers

4

1 回答 1

1

也许 javascript/jquery 方法对您有用。

您可以将 onclick 选择器分配给您的链接,并让它们为您显示不同的内容。如,

var yourMessage = "I like stuff";

$('#linkId').click(function(){
    $('#containerId').html(yourMessage);
}

带有多个按钮的 jsFiddle 示例 - http://jsfiddle.net/B6QDy/1/ 这当然是您的起点,如何在 php 文件中自定义它完全是您的选择。希望这可以帮助...

于 2013-02-22T03:23:16.743 回答