根据用户从菜单选项中单击的内容显示div [英] show divs according to what the user clicks from a menu choice

查看:73
本文介绍了根据用户从菜单选项中单击的内容显示div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我需要一些帮助(如此常见的一行),我有一个菜单,每个链接分别有自己的div,是的,当你点击div显示的链接时,问题是我想每个div显示没有无论你点击它的链接多少次,如果你点击另一个链接,当你回到原来的时候,div仍会显示。目前我已经部分地完成了这一点,我点击了项目a,然后显示当我点击显示的项目b,如果我回到项目a它再次显示,但我只能得到它2个方舟那样2个div我如何做到这一点,所以它有多个div,所以如果用户点击项目b它会显示,如果它点击项目a它会显示n如果它点击项目c它会显示如果要重新审视项目a,b或c,它们仍将显示。

i我是初学者所以如果我有很多错误,请理解,随时做出任何更正或者如果你有更好的想法,谢谢你

i做了一些测试通过将div 3和4添加到第一行的现有代码并相应地调整其余代码但是它没有工作来交换代码。

这里有一些代码,

代码包括菜单代码和div以及我如何在使用swapsee函数或元素之前我想要的部分实现:


yeah i need some help(such a common line) ,i have a menu and each link has its own div respectively and yeah obviously when u click the link the div shows, the problem is i would like each div to show no matter how many times you click the link for it and if you click on another one and when u go back to the original , the div would still show. at the moment i have partially done that, i click on item a ,that shows then when i click item b that shows and if i go back to item a it shows again, but i can only get it 2 wrk like that with 2 divs how do i do it so it wrks with multiple divs , so if user comes n clicks on item b it''ll show, if it click on item a it''ll show n if it clicks on item c it''ll show and if it was to revisit item a ,b or c they all will still show.
i am i beginner so please if i have many mistakes do understand, feel free to make any corrections or if you have any better ideas,thank you
i did some testing with the swapsee bit of code by adding div 3 and 4 onto the existing code on the first line and adjusting the rest of the code accordingly but it didnt work .
here some code,
the code includes the menu code and the divs and how i have partially achieved wht i wanted as i mentioned before using the swapsee function or element:


展开 | 选择 | Wrap | 行号

推荐答案

嗨......


据我了解你想要在单击链接时显示特殊div,然后隐藏所有其他div。所以你可以通过以下方式调整你的功能:

hi ...

as far as i understand you want to display a special div when clicking a link and hide all other divs then. so you could adapt your function the following way:

展开 | 选择 | Wrap | 行号



现在只需将要显示的div的id传递给该函数...所有其他div将切换为隐藏..
now simply pass the id of the div you want to show to that function ... all other divs will be toggled to hidden ..



哇从未预料到这么快就回复了,谢谢你的回复我还没试过但我肯定会尽快做,只有一件事用上面的引言解释你的意思,我想我知道你的意思但我想我''请问以防万一ks。

wow never expected a reply so soon , thanks for the reply i have''nt tried it out yet but i will sure do ASAP, just one thing explain what u ment by the above quote ,i think i know what u mean but i thought i''d ask just in case , thanks.


你传递了必须显示的div的id ...并且该函数将其可见性设置为可见而所有!其他div将设置为隐藏。


亲切的问候
you pass the id of the div that has to be displayed ... and the function sets its visibility to visible while all! other divs will be set to be hidden.

kind regards


这篇关于根据用户从菜单选项中单击的内容显示div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆