• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

Pop up of side bar question

Hi everyone,

I have a javascript file for a module I purchased and want to make a small change to it. Side Bar Image
When you click on a topic header all of the sub heading pop out also (as in the attached image,  this is what appears after I click "Photo" ).

I would like to change this so that the sub-headings do not pop out at all. All of the other functionality is correct.

Here is the javascript file that I believe controls the page but I'm having some difficulty locating the part that changes this.

$Core.mgfaq = {

    loadActions:function()
    {
    	var sidebar = $('#js_block_border_faq_panel');
    	var top = sidebar.offset().top - parseFloat(sidebar.css('marginTop'));
    	$(window).scroll(function (event) {
    		var ypos = $(this).scrollTop();
    		if (ypos >= top) {
    			sidebar.addClass('fixed');
    		}
    		else {
    			sidebar.removeClass('fixed');
    		}
    	});
    	$.localScroll.hash({
    		queue:true,
    		duration:500
    	});
        $.localScroll({
          queue:true,
          duration:500,
          hash:true,
          onAfter:function( anchor, settings ){}
        });
    	$('ul.faq_submenu li a').click(function(e){
    		var linkHref = $(this).attr('href');
            //var linkHrefID = linkHref;
            var linkHrefClass = linkHref.replace("#", ".");
            var relId = $(this).attr('rel');
            if(relId){
              $('.faq_subaction').hide();
              $('.'+relId).toggle();
            }
            setTimeout(function(){
                $(linkHrefClass).highlightFade({color:'rgb(255, 236, 142)', speed: 2000});
                //$(linkHrefID).highlightFade({color:'rgb(255, 236, 142)', speed: 2000});
            }, 600);
    	});
    	$('#js_block_border_faq_panel ul.action li a').click(function(e){
    		var linkHref = $(this).attr('href');
            //var linkHrefQID = linkHref;
    		var linkHrefID = $(this).attr('rel');
            linkHref = linkHref.replace("#", ".");
            if(linkHrefID){
              $('.faq_subaction').hide();
              $('.'+linkHrefID).toggle();
            }
            setTimeout(function(){
                $(linkHref).highlightFade({color:'rgb(255, 236, 142)', speed: 2000});
                //$(linkHrefQID).highlightFade({color:'rgb(255, 236, 142)', speed: 2000});
            }, 600);
    	});
    }

}

$Behavior.initMGFAQPage = function(){
    $Core.mgfaq.loadActions();
}

Open in new window


Thanks for your help,

D
0
TLN_CANADA
Asked:
TLN_CANADA
  • 3
  • 2
1 Solution
 
RartemassAuthor, martial arts coach, IT ConsultantCommented:
Instead of having the submenu pop out, what do you want them to do?
If they don't pop out, how do you want visitors to access the links?
0
 
TLN_CANADAAuthor Commented:
Hey Rartemass, yes, it can just take them directly to the links section on that page. Sorry for not clarifying that. It's an FAQ page.
0
 
RartemassAuthor, martial arts coach, IT ConsultantCommented:
It has been a while since I have coded in javascript and jquery so take this advice with the requisite grain of salt.
On lines 32 and 46 there is .hide().
Chanigng this to .show() should prevent the elements from hiding and thus remain visible at all times.
0
 
TLN_CANADAAuthor Commented:
Hi, sorry, maybe I wasn't clear in the functionality I wanted. I don't want to sub-menus to appear at all. Changing the hide function to show just makes the page so that the sub-menus can be toggled to show and to hide.

I want to keep the sub menus invisible at all time. The script is already setup so that if a user clicks on a menu item it takes them to take part of the page so all that is needed is to remove the function that opens the sub-menu items upon clicking the menu item.

Thanks,

D
0
 
RartemassAuthor, martial arts coach, IT ConsultantCommented:
OK that makes sense now.
Do you have the sub menus specified in the HTML at all? I would first remove any sub menus or at least set them to display:none in the CSS.
This may not resolve the issue however.

Do you have this working on a live website that we can take a look at? It will make things easier to pinpoint.
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!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now