简体   繁体   English

单击菜单时,使toogle选项卡打开,单击其他菜单项时,关闭

[英]Making toogle tabs open when clicked on menu, and close when other menu item is clicked

I`ve made this website http://intelmarketing.mk/demos/mediahuset/ and I need help with the menu (toogle tabs). 我已经将该网站设置为http://intelmarketing.mk/demos/mediahuset/,并且我需要菜单(切换标签)方面的帮助。

The idea is when a menu item is clicked the page to scroll down and open the toogle coresponding the menu item. 这个想法是当单击菜单项时,页面向下滚动并打开与菜单项相对应的装备。 I taught that it can be done with 我教过可以做到

<a href="#link1">Take me to Link 1</a>
<a id="link1">Link 1</a>

Made the headers to be images with id's and clicking on the menu scrolls down to the toogle, but not opening. 将标题设置为带有ID的图像,然后单击菜单上的,向下滚动到“ togle”,但不会打开。

Also when other menu item is clicked (or tab) the already opened toogle needs to close. 同样,当单击其他菜单项(或选项卡)时,已经打开的电子狗也需要关闭。

Any help will be welcomed. 任何帮助都将受到欢迎。

Best regards, Nikola. 最好的问候,尼古拉。

SITE: http://intelmarketing.mk/demos/mediahuset/ 现场: http : //intelmarketing.mk/demos/mediahuset/

Update** 更新**

The site is build on wordpress platform, and for the toogle tabs I use whistle plugin. 该网站是在wordpress平台上构建的,对于toogle选项卡,我使用口哨插件。 wordpress.org/plugins/whistles/ wordpress.org/plugins/whistles/

The menu are simple images. 菜单是简单的图像。

On click of "our work" you wish that page should scroll down and a tab should slide down. 在单击“我们的工作”时,您希望页面向下滚动并且选项卡应该向下滑动。 Presently the page is scrolling down, however tab is not sliding. 当前页面正在向下滚动,但是选项卡没有滑动。 Am I correct? 我对么? You could add two events to your navigation bar tabs 1) to scroll down 2)to slide tab 2nd event is slideToggle() that you're already using 您可以将两个事件添加到导航栏选项卡1)向下滚动2)滑动选项卡2nd事件是您已经在使用的slideToggle()

This is not a clean way, but it should work. 这不是一个干净的方法,但它应该可以工作。

Cheers 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM