I have the following jquery script:
<script>
$(document).ready(function () {
$(".clickable").click(function () {
$(this).animate({left: '1030px'}, function () {
$(this).fadeOut("slow", function () {
document.location.href = $(this).get(0).id + ".php";
});
});
});
});
$(document).ready(function () {
$("#Chi").animate({left: '0'}, {duration: 200, queue: false});
$("#Dove").animate({left: '0'}, {duration: 400, queue: false});
$("#Quando").animate({left: '0'}, {duration: 600, queue: false});
$("#Cosa").animate({left: '0'}, {duration: 800, queue: false});
var phpvariable=<? echo $row; ?>
$('.dreams-photo-profile-mydream').css({"background": "url(\"/images/user.png\")"});
$('.dreams-photo-profile-mydream').css({"background-repeat": "no-repeat"});
$('.dreams-photo-profile-mydream').css({"background-position": "center"});
$('.dreams-photo-profile-mydream').css({"background-size": "contain"});
});
</script>
And i'm trying to pass a php variable like so:
<?php
$gdb->connettiDB();
$row = $gdb->getFotoProfilo(getId());
?>
var phpvariable=<? echo $row; ?>
That 's not working. When i declare a var inside the script, everything seems blocked and my animations aren't working and I don't know why. Can anyone explain me how can I exactly do that?
getFotoProfilo()function makes?