简体   繁体   English

单击“ JQuery”选项卡时刷新选项卡内容

[英]Refresh tab content on click in JQuery tabs

Im having an issue with using tabs via Visual Composer for Wordpress, along with an extension for Visual Composer called Visual Composer Modal Popups. 我在通过Visual Composer for Wordpress使用选项卡以及称为Visual Composer Modal Popups的Visual Composer扩展时遇到问题。

Basically I have all my sub level pages loading in tabs, although it seems to not load any Jquery scripts needed for the content with in each tab, unless I refresh the page (in which they then seem to work fine). 基本上,我将所有子级别的页面都加载到了选项卡中,尽管似乎没有加载每个选项卡中的内容所需的任何Jquery脚本,除非我刷新页面(然后在这些页面中它们似乎可以正常工作)。

Link: http://gjwalsh.marketingmatch.net.au/who_we_are-2/ 链接: http//gjwalsh.marketingmatch.net.au/who_we_are-2/

"Team members" tab on the above page is the trouble. 上一页的“团队成员”选项卡很麻烦。

Is there anyway I can force load or force refresh upon clicking a tab? 无论如何,单击选项卡后我是否可以强制加载或强制刷新?

This way the content would appear correctly first time and not after manually refreshing the page. 这样,内容将在第一次而不是在手动刷新页面后正确显示。 Or I'm open to any other suggestions as I am not that code savvy, any help is greatly appreciated in advance! 或者,我愿意接受任何其他建议,因为我不精通代码,因此需要提前提供任何帮助!

I'll suggest load jquery and assign the id to that tab and on click function reload the page. 我建议加载jquery并将ID分配给该标签,然后在click函数上重新加载页面。

jQuery("#team").click(function() {  location.reload(true); });

Or Using Javascript with the help of onclick function 或在onclick函数的帮助下使用Javascript

<a href="#tab-1403849707999-3-7" id="team" onClick="window.location.reload()">TEAM MEMBERS</a>

Disabling AJAX on the pages with external plug-ins seemed to be the easiest way to fix this thanks to the theme developers. 借助主题开发人员,使用外部插件在页面上禁用AJAX似乎是解决此问题的最简单方法。

Thanks for your help Roschach! 感谢您的帮助Roschach! Your suggestion did work although wasnt the solution I was after in the end. 您的建议确实奏效了,尽管最后没有我想要的解决方案。

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

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