根据单击的链接将信息加载到 div 中
我有一个包含左侧和右侧的 WordPress 页面。在左侧,我将提供大量有关设计的信息,在右侧,我将提供大量有关营销的信息。
每一面都有一系列子类别,因此在设计中它有品牌、印刷等。右侧(营销)有它自己的子类别。本质上这些只是链接。
这就是我想要发生的事情:
当用户单击左侧的任何链接(这些是子类别)时,我希望它加载其下方的一些信息。如果他们点击另一个链接,它将用更多信息替换该信息。右侧也应该发生同样的情况。
所以本质上我想要左侧的大量链接将信息加载到该侧的 div 中,并希望右侧的大量链接将信息加载到该侧的 div 中。
所以我希望左侧和右侧能够独立工作。
解决这个问题的最佳方法是什么?
更新:
<div id="design">
<h1 style="width:65px;">Design</h1>
<a href="test-link">Branding</a>, <a href="test-link">Print</a>
<div id="design-services">
</div>
</div>
<div id="marketing">
<h1 style="width:95px;">Marketing</h1>
<a href="test-link">Advertising</a>, <a href="test-link">Campaigns</a>
<div id="marketing-services">
</div>
</div>
因此,设计 div 中的链接将更改设计服务 div 中的信息,而营销 div 中的链接将更改营销服务 div 中的信息。全部无需重新加载页面。
I have a wordpress page that contains a left side and a right side. In the left side I'm going to have a load of info on design and in the right it will have a load of info on marketing.
Each side has a series of sub categories, so within design it has branding, print etc etc. The right side (marketing) has it's own sub categories. Essentially these are just links.
This is what I want to happen:
When the user clicks any of the links (these are the subcategories) on the left side I want it to load some info below it. If they click another link it will replace that info with some more info. The same should happen with the right side.
So essentially I want a load of links on the left side to load info into a div on that side and a load of links on the right to load info into a div on that side.
So I want the left and right side to work independently from each other.
What would be the best way to go about this?
UPDATE:
<div id="design">
<h1 style="width:65px;">Design</h1>
<a href="test-link">Branding</a>, <a href="test-link">Print</a>
<div id="design-services">
</div>
</div>
<div id="marketing">
<h1 style="width:95px;">Marketing</h1>
<a href="test-link">Advertising</a>, <a href="test-link">Campaigns</a>
<div id="marketing-services">
</div>
</div>
So the links within the design div would change the info within the design-services div and the links within the marketing div will change the info in the marketing-services div. All without reloading the page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我想到的第一个解决方案。
http://jsfiddle.net/pQKUc/15/e
如果您需要进一步说明,请告诉我。 :)
HTH
This is the first solution that comes to mind.
http://jsfiddle.net/pQKUc/15/e
Let me know if you need further clarification. :)
HTH