Jquery help

TrueJewix

Member
Aug 9, 2012
332
21
<script>
$(document).ready(function(){
$(".chameleon-hover").click(function(){
$(".quicklink-side").css("margin-top", "30px");
});
});
</script>

How do I add a 3000 delay to it?
 
fuck u
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,484
1,485
HTML:
$(document).ready( function() {
  $(".chameleon-hover").on('click', function() {
    setTimeout( function() {
      $(".quicklink-side").css("margin-top", "30px");
   }, 3000);
  });
});
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,484
1,485
HTML:
$(document).ready( function() {
  $(".chameleon-hover").on('click', function() {
    $(".quicklink-side").delay(3000).slideUp(3000);
  });
});
 

TrueJewix

Member
Aug 9, 2012
332
21
HTML:
$(document).ready( function() {
  $(".chameleon-hover").on('click', function() {
    $(".quicklink-side").delay(3000).slideUp(3000);
  });
});
Yeah but with
$(".chameleon-hover").on('click', function() {
setTimeout( function() {
$(".quicklink-side").css("margin-top", "30px");
 
@TesoMayn, like
<script>
$(document).ready(function(){
$(".chameleon-hover").click(function(){
$(".quicklink-side").css("margin-top", "30px");
});
});
</script>

but I want it to slideUp with a delay.
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,484
1,485
Not sure why you'd want both but okay...
HTML:
$(document).ready( function() {
  $(".chameleon-hover").on('click', function() {
    setTimeout( function() {
      $(".quicklink-side").css('margin-top', '30px').slideUp(3000);;
    }, 3000);
  });
});
 

Users who are viewing this thread

Top