mohsin mohsin - 8 months ago 60
CSS Question

div animation not repeating on click in jquery

I am trying to animate div from outside the window to inside every time I click on link but it works only one time not again, please help me where I am wrong.

<a id='ajaxLoad1' onclick='ajaxFunc(event, this);' href="url1">1st content</a>
<a id='ajaxLoad2' onclick='ajaxFunc(event, this);' href="url2">2nd content</a>

<div id='contentDiv' style="background: #98bf21; height: 200px; width: 800px; position: absolute;"></div>

function ajaxFunc(param, thisParam) {

var href = $(thisParam).attr('href');
var position = '100px';

$("#contentDiv").animate({right: position});


  'right': 'initial',
  'margin-left': '-100%'