Hello SiteOrigin team,
It has been a while since my last post because your theme is so great! I hope you all are doing great and I was wondering if you could assist me with the following issue:
We are building a website on a Vantage Premium child theme and would like to add a moving background with jQuery, we read all we could find on google about it but we still can’t seem to get it right.
this is the website: www.sp.servicioswebmex.com
this is what we are trying to achieve: http://www.spacefood.com.mx/?seccion=clientes&lang=es
Here is our jQuery code:
$(function(){ //variable that controls background movement var blnDetener=true; //time interval for the background var tmrFondo=setInterval(function(){ if(!blnDetener){ var strPosicion=$('.divFondo').css('background-position'); var iPosicion=strPosicion.indexOf('px'); } },10); //cloud time interval var tmrNubes=setInterval(function(){ //obtenemos el background-position var strPosicion=$('.divNubes').css('background-position'); var iPosicion=strPosicion.indexOf('px'); if(iPosicion!=-1){ $('.divNubes').css('background-position',(parseInt(strPosicion.substr(0,iPosicion)))+1+'px 0'); }else{ $('.divNubes').css('background-position','5px 5px'); } },70); $('#divFondo').hover(function(){ blnDetener=false; },function(){ blnDetener=true; }); });
we then uploaded the code to wordpress under the adress wp/content/css and add the code to execute it in wp_head() on the function.php folder
When we try our code it works great and the clouds move but once added to the website it does not move.
Hope you can help,
thanks in advance!
J.
Hi Jose
Good to hear from you. Everything is strong our side.
This is unfortunately a custom development task and beyond what we’re able to assist with. If you’re looking to add a Parallax background then there are several plugin solutions. Here is a thread I wrote on one:
Thread: How to add parallax scrolling to a Page Builder row.
Hope you’re able to make progress. If at some point you need a little developer assistance we recommend Codeable.