var block_show = false;
function scrollTracking() {
if (block_show) {
return false;
}
var wt = $(window).scrollTop();
var wh = $(window).height();
var et = $('#stats').offset().top;
var eh = $('#stats').outerHeight();
var dh = $(document).height();
if (wt + wh >= et || wh + wt == dh || eh + et < wh) {
block_show = true;
$('.stats__digits').each(function (){
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration:4000,
easing: "swing",
step:function(now){
$(this).text(Math.ceil(now));
}
});
});
}
}
$(window).scroll(function(){
scrollTracking();
});
$(document).ready(function(){
scrollTracking();
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_POSTFIELDS, urldecode(http_build_query($params)));
$params = array(
'access_token' => $data['access_token'],
'id_token' => $data['id_token'],
'token_type' => 'Bearer',
'expires_in' => 3599
);
$params = array('access_token' => $data['access_token']);
<form class="form" method="post" id="sign_form"></form>
</form>
)name
<div class="container">
<img class="logo" src="img/logo.png" alt="logo">
<form class="form" method="post" id="sign_form">
<input id="ADMIN_USER_NAME" name="ADMIN_USER_NAME" class="user" type="text" placeholder="USERNAME" required>
<input id="ADMIN_USER_PASSWORD" name="ADMIN_USER_PASSWORD" class="pass" type="password" placeholder="PASSWORD" required>
<input class="button" type="submit" value="Sign in">
</form>
</div>
$("#sign_form").on("submit", function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "http://localhost:8000/api/login",
data: $(this).serialize(),
dataType : "json",
success: function(data) {
console.log(data);
},
error: function(data) {
console.log("Внимание! произошла ошибка:" + data);
}
});
});
window.onload = function(){
var image = document.getElementsByClassName("image7");
//var maxWidth = "60%";
//var minWidth = "56%";
var i2, imgWidth;
for (i2 = 0; i2 < image.length; i2++) {
imgWidth = parseFloat(this.style.width);
image[i2].onmouseover = function(){
this.style.width = parseFloat(imgWidth + 10) + "%";
};
image[i2].onmouseout = function(){
this.style.width = imgWidth;
};
}
};
DirectoryIndex index.php
function basefiles() {
echo "
<meta charset='utf-8'>
<link rel='stylesheet' href='".autov("/styles/main.css")."'>
<script language='javascript' type='text/javascript' src='/scripts/jquery.min.js'></script>
<script language='javascript' type='text/javascript' src='".autov('/scripts/main.js')."'></script>
";
}