Reputation: 2522
I have a page where users could open multiple dialogs. The ajax call is to the itself with different parameters based on what was clicked.
each click i increment the variable clicked by 20 in an attempt to move the next dialog over 20 pixels instead of opening the next dialog on top of the previous.
getExtDetails.php
$('.ivrKeyData').click(function(){
var c = "<?php echo $_POST['click'];?>";
if (c.length < 1){
c = 0;
}
var clicked = parseInt(c)+20;
$( "#diag_"+id ).dialog({
title:'From '+header,
position: ['center',clicked],
.....
});
$.ajax({
type:"POST",
data:"id="+data+"&click="+clicked,
url:"getExtDetails.php",
....
});
});
a link on the page
echo :<a href='#' id='".$id."' class='ivrKeyData'>".$id."</a>";
looking at the page source, the value of clicked is incrementing by 20, but the position is not moving...
Upvotes: 0
Views: 21
Reputation: 192
Try all numbers parse to integer.
var clicked = parseInt(parseInt(c)+20);
Upvotes: 1