Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Mini-Tabbed Window section in FF not working

    Resolved -
    Hi! I am new to this forum and am hoping I can find some help here. I am not a JS coder, but am trying to use a little bit of code. I have a section on a web page that I want to have tabbed areas in so when the user clicks on the 1st tab, information related to that tab is displayed. When they click on the 2nd tab, informaiton related to the 2nd tab is displayed and so on. This actually is working if you view the page via IE, but I need it to also work via FF.

    I have the JS and CSS files online. Here is the webpage: http://www.aahahealthypet.com/tab_testing.html

    Here is the JS:
    Code:
    //a public function that the container uses to pass in values for the labels
    function public_Labels(label1, label2, label3, label4){
    	
    	document.getElementById("t1").innerText = label1;
    	document.getElementById("t2").innerText = label2;
    	document.getElementById("t3").innerText = label3;
    	document.getElementById("t4").innerText = label4;
    }
    
    //a public function that the container uses to pass in values for the card containers
    function public_Contents(contents1, contents2, contents3, contents4){
    
    	document.getElementById("t1Contents").innerHTML = contents1;
    	document.getElementById("t2Contents").innerHTML = contents2;
    	document.getElementById("t3Contents").innerHTML = contents3;
    	document.getElementById("t3Contents").innerHTML = contents3;
    
    	init();
    }
    
    //sets the default display to tab 1
    function init(){
    	document.getElementById("tabContents").innerHTML =document.getElementById("t1Contents").innerHTML;
    }
    
    //this is the tab switching function
    var currentTab;
    var tabBase;
    var firstFlag = true;
    
    
    function changeTabs(evt){
    	if(window.event) evt=window.event;
    
    	if(firstFlag == true)
    	{
    		currentTab = document.getElementById("t1");
    		tabBase = document.getElementById("t1base");
    		firstFlag = false;
    	}
    
    	if(evt.srcElement.className == "tab"){
    		
    		currentTab.className = "tab";
    
    		tabBase.style.backgroundColor = "";
    
    		currentTab = window.event.srcElement;
    
    		tabBaseID = currentTab.id + "base";
    
    		tabContentID = currentTab.id + "Contents";
    
    		tabBase = document.all(tabBaseID);
    
    		tabContent = document.all(tabContentID);
    
    		currentTab.className = "selTab";
    		
    		tabBase.style.backgroundColor = "";
    
    		document.getElementById("tabContents").innerHTML = tabContent.innerHTML;
    	}
    }
    Thank you, Thank you, Thank you for any help anyone can give me.
    Last edited by hlj71; 08-17-2009 at 06:47 PM.

  • #2
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Resolved

    Sorry to have bugged you guys. I just got some help from another forum that fixed my FF problem. Here is the link to the post in case someone else is looking for similar help.

    http://www.webdeveloper.com/forum/sh...d.php?t=214869

  • #3
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    was on testing when it was failing due to evt being undefined. by the time i was typing a response you changed your script and it's now working in FF. guess you got it sorted :P


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •