The main goal here is to achieve an instant "jump" to the right without any flashing effects. Instead of using .animate()
, which can cause a flickering effect, I believe that .css()
will provide the desired instantaneous movement to the right.
However, for some reason this approach does not seem to work as expected and I have to resort to a workaround using .animate()
:
$("#gallery ul").animate({right: posVar},0);
Below is the snippet of my current code:
setTimeout(function(){
var posVar = 2838;
$('#gallery ul').css("right", posVar);
}, 300);
What could be causing this issue?
CSS:
#gallery ul {
display:block;
position:relative;
width:14000px; /*auto calculated from javascript */
}