queue  41
support
Results 1 to 6 of 6

Thread: [SOLVED] portfolio link doesn't work

  1. #1
    Junior Member
    Join Date
    Jan 2017
    Posts
    7

    portfolio link doesn't work

    hello,

    I have a problem when you click on image of portfolio you have a description, photo and button but the button doesn't work. I want to link it with the footer of my homepage in contact but when I put #contact in link button it doesn't work. I already had this problem with the top button like hire us but I find the JS on this forum. I can't give you my password and my id because I'm on XAMPP. thanks for your feedback

    Thomas

    Ps: sorry for my english, he's very bad (I'm french...lol)

  2. #2
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hi,

    no worries about your english, it's pretty good

    Do you remember where you found the JS you mentioned, and could you link me to that thread so that I can check the JS code and possibly adjust it for you?

    Thanks

  3. #3

  4. #4
    Junior Member
    Join Date
    Jan 2017
    Posts
    7
    Up

  5. #5
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    16,930
    Hi,

    try changing that code to this:
    Code:
    jQuery( function( $ ) {
      
      var $navigation = jQuery( '#the-navigation' ),
      isLoggedIn = jQuery( '#wpadminbar' ).length;
      
      peThemeOffset = isLoggedIn ? $navigation.outerHeight() + jQuery( '#wpadminbar' ).height() : $navigation.outerHeight();
      
      jQuery('body').on( 'click', 'a', function( e ) {
        
        var $this = jQuery( this ),
        target = '#section-' + $this.prop( 'hash' ).substring(1);
        
        if ( $this.closest( '.smoothscroll' ).length ) {
          
          return;
          
        }
        
        if ( window.location.href.replace( window.location.hash, '' ) === $this.attr( 'href' ) ) {
          
          e.preventDefault();
          
          jQuery.smoothScroll(0);
          
          return;
          
        }
        
        if (  '' === $this.prop( 'hash' ) || ! jQuery( 'body' ).find( target ).length ) {
          
          return;
          
        }
        
        jQuery.smoothScroll({
          speed: 800,
          offset: -peThemeOffset,
          scrollTarget: target
        });
        
      });
      
    });

  6. #6
    Junior Member
    Join Date
    Jan 2017
    Posts
    7
    Thank you Ante I'll try this now.. thank you so much !! you save my life !!! lol