Solved

JQuery Tabs

Posted on 2011-03-18
1
420 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

914 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

23 Experts available now in Live!

Get 1:1 Help Now