D
D
denis_milyukov2015-10-08 17:36:38
JavaScript
denis_milyukov, 2015-10-08 17:36:38

Flyout block on top of jquery?

Good evening W.W. Connoisseurs tell me how to make a leaving block from top to bottom with storing the position on cookies.
The cookie library is naturally connected!

Thank you very much in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-10-09
@denis_milyukov

var topDate;
$('#btnDate').click(function(e){
e.preventDefault();
topDate = topDate === 0 ? -200 : 0;
$('#times').animate({
top: topDate
}) ;
});

So?
$(function(){
  var topDate = +$.cookie("topValue")||0;

  $('#btnDate').click(function(){
    $.cookie("topValue", topDate = -topDate - 200);  
    $('#times').animate({top: topDate});
  }).click();
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question