Solved

JQuery Tabs

Posted on 2011-03-18
1
419 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
1 Comment
 
LVL 4

Accepted Solution

by:
chuckalicious earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now