• Resolved designdrumm

    (@designdrumm)


    Hello,
    I “think” I found a bug in your theme.

    On mobile Safari, the back to top div’s opacity just keeps rotating numbers and never appears. It starts to lag Safari after a while as it is a continuous loop.

    Look forward to an update. Great theme!

    Best,
    designdrumm

Viewing 4 replies - 1 through 4 (of 4 total)
  • Tanay

    (@tanaykhandelwal-1)

    Hey, I also checked this the theme author forcefully made the back to top icon hidden by using !important in CSS for mobile and iPads next jQuery tries to make it visible after some scroll from the top you can check on the desktop where the back to top button is visible.
    Hope they will fix it in the next update. It is really a Great Theme!

    Best,
    Tanay Khandelwal

    Thread Starter designdrumm

    (@designdrumm)

    Well I couldn’t wait for a fix, so I fixed it.
    Here is the code I changed with line numbers and file name.

    File: custom.js
    Lines 141 to 156
    Replace this:

    
    //BACK TO TOP -----------------------------------------
    //-----------------------------------------------------
    jQuery(document).ready( function() {
    'use strict';
    jQuery('#back-to-top,#backtop').hide();
    jQuery(window).scroll(function() {
    if (jQuery(this).scrollTop() > 100) {
    jQuery('#back-to-top,#backtop').fadeIn();
    } else {
    jQuery('#back-to-top,#backtop').fadeOut();
    }
    });
    jQuery('#back-to-top,#backtop').click(function(){
    jQuery('html, body').animate({scrollTop:0}, 'slow');
    });
    });
    

    With this:

    
    //BACK TO TOP -----------------------------------------
    //-----------------------------------------------------
    var currpos = 0;
    jQuery(window).load(function() {
    	if(jQuery('#back-to-top,#backtop').css("opacity")*1 === "NAN" ||
    		jQuery('#back-to-top,#backtop').css("opacity")*1 > 0) {
    		jQuery('#back-to-top,#backtop').animate({
    			opacity:0
    		}, 0, 'easeInCirc', function() {
    			jQuery(this).css({display: "none"});
    		});
    	}
    });
    jQuery(document).ready( function() {
    	'use strict';
    	jQuery(window).scroll(function() {
    		currpos = jQuery(this).scrollTop();
    		if(currpos > 100) {
    			jQuery('#back-to-top,#backtop').css({display: "block"}).animate({
    				opacity:1
    			}, 500, 'easeOutCirc');
    		} else {
    			jQuery('#back-to-top,#backtop').animate({
    				opacity:0
    			}, 500, 'easeInCirc', function() {
    				jQuery(this).css({display: "none"});
    			});
    		}
    	});
    	jQuery('#back-to-top,#backtop').click(function(){
    		jQuery("html, body").animate({
    			scrollTop:0
    		}, 800, 'easeOutExpo', function(complete) {
    			if(complete) {
    				currpos = 0;
    			}
    		});
    	});
    });
    

    ———————————————————————————————————————

    File name: style.css
    Line 492
    Replace this:

    
    a#backtop {background: none no-repeat scroll 0 0 #F54336; bottom:7px; height: 35px; line-height: 16px; position: fixed; right: 30px; text-decoration: none; width: 35px; z-index: 9999} 
    

    With this:

    
    a#backtop {background: none no-repeat scroll 0 0 #F54336; bottom:7px; height: 35px; line-height: 16px; position: fixed; right: 30px; text-decoration: none; width: 35px; z-index: 9999;display:none;opacity:0;}
    

    _______________________________________

    File name: bootstrap-responsive.css
    Lines 899, 1122, 1331

    Remove the !important statement.

    This:

    a#backtop { display:none !important;}

    should be this:

    a#backtop { display:none;}

    _______________________________________

    Hope that helps someone and possibly gets adopted by the developers as a fix and is in the next update. Now Safari doesn’t go into an infinite loop. I also hope I did the formatting right for this forum. Guess I’ll know once I submit since there is no preview of what you submit here.

    Best,
    designdrumm

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Well I couldn’t wait for a fix, so I fixed it.
    Here is the code I changed with line numbers and file name.

    Such a bad idea to modify a theme, instead please create a child theme and make your modifications there.

    https://codex.wordpress.org/Child_Themes

    Thread Starter designdrumm

    (@designdrumm)

    The reason it is a bad idea is because the developers of the theme will eventually update (hopefully) their theme and when you update, it will over-write any edits you do to the theme files.

    This is assuming that you are too lazy to keep a copy of your edits separate from the theme files and are not willing to update said theme with your edits every time they update their theme, or rework your edits if the theme structure changes.

    I for one am willing and this is just a back to top button anyways. Seems a bit “silly” to me to create a whole child theme that has to load ON TOP OF the regular theme just for a back to top button. I’d rather save my bandwidth for my users and not use a child theme. SO, with that said and with what the moderator has said, edit at your own risk.

    Considering the lack of response from the theme developers on ANY of my threads, I am not too worried. But yes! Please use a child theme if that is what suits your situation better or if you wish to stick with the status quo.

    Personally I wish they would change how WordPress handles this.

    Best,
    designdrumm

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Back To Top bug’ is closed to new replies.