• Hello, I want to create links between Main content and CTA (CTA 2, Open content). So that that Front page scrolls down once you click the link. No new tabs. Could you help, please.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author lyrathemes

    (@lyrathemes)

    Thanks for trying out Vega, we appreciate it ?? As I understand it, you’re trying to create a link from the main content area down to the CTA and not add those links to the main menu?

    In order to do that, please enter the link as follows (in the main content):

    <a href="#cta">CALL TO ACTION</a>

    Make sure that the #cta matches the name of the section (Appearance > Customize > Front Page > CTA Section).

    Hope that helps.

    Thread Starter Oleg Gordeev

    (@oleggordeev)

    Thanks a lot! It works.
    The only thing is the link brings you straight to CTA. I thought the page would scroll down to CTA.

    Theme Author lyrathemes

    (@lyrathemes)

    That would require a few edits to the JavaScript file, if you’re comfortable? So edit assets/vega-wp.js and change this block of code

    $('.menu-header .page-scroll a').click(function(){
    		jQuery('.menu-header .page-scroll>a').removeClass('showing');
    		jQuery(this).addClass('showing');
    		var href = jQuery(this).attr('href').split('#');
    		var Header_height = jQuery('.navbar-custom').innerHeight();
    		if(href[1]){
    			if(jQuery('#'+href[1]).length>0){
    				var posEle =jQuery('#'+href[1]).offset().top - Header_height;
    				jQuery('html,body').animate({scrollTop:posEle},600);
    				return false;
    			}
    		}
    	});

    to

    $('.page-scroll a').click(function(){
    		jQuery('.menu-header .page-scroll>a').removeClass('showing');
    		jQuery(this).addClass('showing');
    		var href = jQuery(this).attr('href').split('#');
    		var Header_height = jQuery('.navbar-custom').innerHeight();
    		if(href[1]){
    			if(jQuery('#'+href[1]).length>0){
    				var posEle =jQuery('#'+href[1]).offset().top - Header_height;
    				jQuery('html,body').animate({scrollTop:posEle},600);
    				return false;
    			}
    		}
    	});
    

    Hope that helps.

    Thread Starter Oleg Gordeev

    (@oleggordeev)

    This JavaScript file. Where is it? In the theme editor?

    Theme Author lyrathemes

    (@lyrathemes)

    It’s in assets/js/vega-wp.js

    Thread Starter Oleg Gordeev

    (@oleggordeev)

    Thanks, I will try that. Could you also, please, provide a similar link from Main content to footers.

    • This reply was modified 7 years, 11 months ago by Oleg Gordeev.

    Hi there,

    In order to do that, please enter the link as follows (in the main content):

    <a href="#open">FOOTER</a>

    then add the following code to assets/vega-wp.js file right below the content you’ve added before:

    $('#open').click(function(e){
      e.preventDefault();
      jQuery('.menu-header .page-scroll>a').removeClass('showing');
      var href = jQuery(this).attr('href').split('#');
      var Header_height = jQuery('.navbar-custom').innerHeight();
      if(href[1]){
        if(jQuery('#'+href[1]).length>0){
          var posEle =jQuery('#'+href[1]).offset().top - Header_height;
          jQuery('html,body').animate({scrollTop:posEle},600);
          return false;
        }
      }
    });

    Hope that helps.

    Best,
    Jarek
    Vega Support

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Link from Main content to CTA’ is closed to new replies.