usa12fox1 Posted May 15, 2015 Share Posted May 15, 2015 (edited) https://jsfiddle.net/rtGk6/1/ I found this code at http://www.codeitive.com/7HiSPeVjXj/toggle-hidden-divs-by-clicking-on-navigation.html works great untill I take it out of jsfiddle and apply it to my page. I have tried everything i can think off to make it work but no luck it does not function one bit.I have 4 sections on 1 page I need to be able to toggle content in each section with out conflicting the other sections on the page.I could use some help with this issue.Thank You. $('.links').click(function() { var id = $(this).attr('id').split('-').pop(); $('.navLinks,.navLinksb,.navLinksc,.navLinksd').hide(); $('#'+id).show(); }) Edited May 15, 2015 by usa12fox1 Link to comment Share on other sites More sharing options...
Ingolme Posted May 15, 2015 Share Posted May 15, 2015 Did you include jQuery at the beginning of your page? Press F12 to open developer tools to check for any Javascript error messages. 1 Link to comment Share on other sites More sharing options...
usa12fox1 Posted May 15, 2015 Author Share Posted May 15, 2015 Yes I have and the 1.9.1 is used on jsfiddle I also used newer versions,still no luck. Thank you. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script> var jQ = jQuery.noConflict();</script> <script language="JavaScript" type="text/javascript" src="/js/mb/global.js?v1.22"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> var jQ = jQuery.noConflict();</script> <script language="JavaScript" type="text/javascript" src="/js/mb/global.js?v1.22"></script> Link to comment Share on other sites More sharing options...
Ingolme Posted May 15, 2015 Share Posted May 15, 2015 Put your own code at the bottom of the page, before the closing </body> tag. The language attribute is deprecated and not needed, the type attribute in HTML 5 is optional, so I'd remove all of those attributes. 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted May 15, 2015 Share Posted May 15, 2015 (edited) If you are using .noConflict(); for this code specifically, then instead of '$' use 'jQ' instead. Edited May 16, 2015 by dsonesuk 1 Link to comment Share on other sites More sharing options...
thescientist Posted May 16, 2015 Share Posted May 16, 2015 are you checking for Javascript errors in the console? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now