how do i animate an element to the right w/jquery, javascript?
i used this code to animate some divs
'use strict';
var $slog1 = $("#slog1Js");
var $slog2 = $("#slog2Js");
var $slog3 = $("#slog3Js");
var $gears = $("#gearsJs");
var $shield = $("#shieldJs");
var $bulb = $("#bulbJs");
var $sq1 = $("#square1");
var $sq2 = $("#square2");
var $sq3 = $("#square3");
/*var $a = 1;*/
$(document).ready(function(){
$slog2.animate({"opacity":"1"},4000);
$slog3.animate({"opacity":"1"},7000);
$gears.animate({"top":"250px"},2000,"linear");
$shield.animate({"top":"250px"},3000,"linear");
$bulb.animate({"left":"250px"},4000,"linear");
var angle = 0;
setInterval(function(){
angle+=3;
$("#square1").rotate(angle);
},50);
});
works great, no problem. but when i tried to change any of the elements to animate to the right they just do not go anywhere. top, left, not right…
i am currently using this code
jQuery(document).ready(function($){
//$("#toggle").click(function(){
// $("#disclaimer").slideToggle('slow', function(){
// $("#toggle").toggleClass('active')
//});
//});
$(".sidebar-toggle").click(function(){
$("#secondary").animate({width: 'toggle'});
});
});
to animate my side bar but am trying to edit the animation so it is smoother and comes in from the right.
Could i please get some advice on how to do this?
thx
D