Answer the question
In order to leave comments, you need to log in
Why doesn't the block exit work when the button is pressed?
There is a class On_seorch_interface, when you click on it leaves . And when you click on with the getstyle class, it leaves.
Normally, this only works once. Further, the script "lives its own life". Where is the mistake?
$(document).ready(function() {
var timeout_id;
var tgl = 1
$(".getstyle").click(function() {
if (tgl !== 1) {
timeout_id = window.setTimeout(function() {
$(".serch_fild_block").animate({
height: 'hide'
}, 800, 'easeInCirc')
}, 100);
$(".form-controls").animate({
marginLeft: '2500px'
}, 900, 'easeInCirc')
}
});
$(".On_seorch_interface").click(function() {
if (tgl === 1) {
$(".serch_fild_block").animate({
height: 'show'
}, 800, 'easeInCirc');
timeout_id = window.setTimeout(function() {
$(".form-controls").animate({
marginLeft: '500px'
}, 1000, 'easeOutQuart')
}, 800);
tgl = 0
} else {
tgl = 1
}
});
});
Answer the question
In order to leave comments, you need to log in
I would start by looking in the debugger and seeing an error about an unknown easing function. Remove from the parameters to animate ", 'easeOutQuart'" and the code will start working. True, this does not cancel the general curvature of the code.
The author, can you find out the original task, which was?
When I click in jsFiddle in the developer console (F12), I see
an Uncaught TypeError: jQuery.easing[this.easing] is not a function
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question