New Landing How can we help? Themeforest Theme Support Dante Back to Top not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Dante
  • #77398
    seanarcher
    Member
    Post count: 55

    Hi,

    wheni place “back to top” dividers, the links are not working. I guess it’s because of my manual use of the smooth-sroll options set under custom JS:

    <script>
    jQuery('a[href^="#"]').bind('click.smoothscroll',function (e) {
    	e.preventDefault();
    	var target = this.hash;
    	$target = jQuery(target);
    	jQuery('html, body').stop().animate({
    	'scrollTop': $target.offset().top-50
    	}, 500, 'swing', function () {
    	window.location.hash = target;
    	});
    });
    </script>

    Since i need this function because of my links within pages – how can i make the “back to top” dividers work as well?

    thank you !

    #77427
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove that one code and use this one

    <script>
    jQuery('a[href^="#"]').bind('click.smoothscroll',function (e) {
    if(this.attr('id') == 'back-to-top' ) return true;
        e.preventDefault();
        var target = this.hash;
        $target = jQuery(target);
        jQuery('html, body').stop().animate({
        'scrollTop': $target.offset().top-50
        }, 500, 'swing', function () {
        window.location.hash = target;
        });
    });
    </script>

    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #77515
    seanarcher
    Member
    Post count: 55

    works perfect, the only thing that my nice “scroll” effect is gone now, it just “jumps” to the position. any chance to integrate that nice “smooth-scroll” effect again into this ?

    thank you very much

    #77517
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove that one code and use this one

    <script>
    jQuery('a[href^="#"]').bind('click.smoothscroll',function (e) {
      e.preventDefault();
    if(this.attr('id') == 'back-to-top' ) return true;
      
        var target = this.hash;
        $target = jQuery(target);
        jQuery('html, body').stop().animate({
        'scrollTop': $target.offset().top-50
        }, 500, 'swing', function () {
        window.location.hash = target;
        });
    });
    </script>
    #77528
    seanarcher
    Member
    Post count: 55

    Hmm.. now it doesn’t work at all ๐Ÿ™‚ I get:

    Uncaught TypeError: undefined is not a function

    #77531
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Hi,
    Please remove that one code and use this one

    <script>
    jQuery('a[href^="#"]').bind('click.smoothscroll',function (e) {
      e.preventDefault();
    if(this.attr('id') != 'back-to-top' ) {
      
        var target = this.hash;
        $target = jQuery(target);
        jQuery('html, body').stop().animate({
        'scrollTop': $target.offset().top-50
        }, 500, 'swing', function () {
        window.location.hash = target;
        });
    }
    });
    </script>

    Hope that will work sure.

    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #77534
    seanarcher
    Member
    Post count: 55

    still the same ๐Ÿ™‚ ๐Ÿ™

    #77535
    Mohammad – SUPPORT
    Moderator
    Post count: 27441
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register