?
Solved

JQuery Tabs

Posted on 2011-03-18
1
Medium Priority
?
427 Views
Last Modified: 2012-05-11
Hi,

I've implemented a JQuery Tab functionality using the following code:

 
$(document).ready(function() {
	
	// Tab Effect
	$("#news-tab .tab-content").hide(); //Hide all content
	$("#news-tab .tab-title ul li:first").addClass("active").show(); //Activate first tab
	$("#news-tab .tab-content:first").show(); //Show first tab content

	//On Click Event
	$("#news-tab .tab-title ul li").click(function() {
		$("#news-tab .tab-title ul li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$("#news-tab .tab-content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

Open in new window


However when I'm using a CMS it doesn't allow me to edit the individual tabs - can anyone recommend a way that when I access this page via the CMS, this function won't run and will display the tabs in a manner I can edit them. But will operate when I access the front end website.

Many thanks,

Webbo
0
Comment
Question by:Webbo_1980
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
chuckalicious earned 2000 total points
ID: 35169379
If you mean that you have a webpage that when viewed by a user, has tabs containing content, but when viewed in an "edit" mode in the CMS, the editor needs to be able to modify the actual structure of the tabs, or do they need to be able to edit the content of each tab?

For any CMS' I've put together, I've used CKEditor for the main body of content, which operates as a WYSIWYG interface for editing content. However for complex pages you can edit the actual source, at which point you could edit/modify the actual tab structure.

Of course I could be totally misunderstanding what you are needing.

Alternatively you could easily build an admin interface which took advantage of the jQuery tabs methods for adding, editing, removing etc.

You will of course need to ensure that whatever backend you are using is able to save these changes to make sure they are permanent.

I hope that's helped in some way.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question