Solved

JQuery Tabs

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

Independent Software Vendors: 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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

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