Help with Mobile CSS

1 reply · opened Aug 26, 2016

PpaingthuchitAug 26, 2016

Hi,

We are having problem with mobile version. Our page is working well on web even with some external Jquery. But when we open it in mobile, canvas CSS animation are not working anymore ( all the external jquery animation used in some pages are working fine, only canvas animation are not working) . i dun know why though. do we need to do anything extra for animation to move?

note: animation means those images and text appearing left and right when scrolling page.

http://starcityuat@futurehubmyanmar.com

SSemicolon WebSTAFFSep 6, 2016

Hello,

[sb_private_reply]We Really Apologize about the Delays in replying to your Support Query and Really Really Appreciate your Patience with us![/sb_private_reply]

We Really apologize about the Inconveniences caused. Actually, Animations have been disabled by default on Mobile Devices for Performance Reasons and to keep the User Experience smooth. However, if you would like to activate this for Mobiles too, then please find the following code in the animations: function() Function Block in the js/functions.js File:

if( $body.hasClass('device-lg') || $body.hasClass('device-md') || $body.hasClass('device-sm') ){
	$dataAnimateEl.each(function(){
		var element = $(this),
			animationOut = element.attr('data-animate-out'),
			animationDelay = element.attr('data-delay'),
			animationDelayOut = element.attr('data-delay-out'),
			animationDelayTime = 0,
			animationDelayOutTime = 3000;

		if( element.parents('.fslider.no-thumbs-animate').length > 0 ) { return true; }

		if( animationDelay ) { animationDelayTime = Number( animationDelay ) + 500; } else { animationDelayTime = 500; }
		if( animationOut && animationDelayOut ) { animationDelayOutTime = Number( animationDelayOut ) + animationDelayTime; }

		if( !element.hasClass('animated') ) {
			element.addClass('not-animated');
			var elementAnimation = element.attr('data-animate');
			element.appear(function () {
				setTimeout(function() {
					element.removeClass('not-animated').addClass( elementAnimation + ' animated');
				}, animationDelayTime);

				if( animationOut ) {
					setTimeout( function() {
						element.removeClass( elementAnimation ).addClass( animationOut );
					}, animationDelayOutTime );
				}
			},{accX: 0, accY: -120},'easeInCubic');
		}
	});
}

and replace it with:

$dataAnimateEl.each(function(){
	var element = $(this),
		animationOut = element.attr('data-animate-out'),
		animationDelay = element.attr('data-delay'),
		animationDelayOut = element.attr('data-delay-out'),
		animationDelayTime = 0,
		animationDelayOutTime = 3000;

	if( element.parents('.fslider.no-thumbs-animate').length > 0 ) { return true; }

	if( animationDelay ) { animationDelayTime = Number( animationDelay ) + 500; } else { animationDelayTime = 500; }
	if( animationOut && animationDelayOut ) { animationDelayOutTime = Number( animationDelayOut ) + animationDelayTime; }

	if( !element.hasClass('animated') ) {
		element.addClass('not-animated');
		var elementAnimation = element.attr('data-animate');
		element.appear(function () {
			setTimeout(function() {
				element.removeClass('not-animated').addClass( elementAnimation + ' animated');
			}, animationDelayTime);

			if( animationOut ) {
				setTimeout( function() {
					element.removeClass( elementAnimation ).addClass( animationOut );
				}, animationDelayOutTime );
			}
		},{accX: 0, accY: -120},'easeInCubic');
	}
});

This will definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard