Created
October 23, 2014 03:42
-
-
Save ljkfgh2008/dc2a03a24537d2b4abea to your computer and use it in GitHub Desktop.
// source http://jsbin.com/boraxa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.js"></script> | |
<script> | |
$(function(){ | |
console.log($('.av-options a')); | |
$('.av-options a').on('click', function(){ | |
if($(this).data('up')){ | |
$(this).parent('.av-options').animate({ | |
height : '100px' | |
}); | |
$(this).removeClass('up'); | |
$(this).addClass('down'); | |
$(this).data('up', 0); | |
} else { | |
$(this).parent('.av-options').animate({ | |
height : '500px' | |
}); | |
$(this).removeClass('down'); | |
$(this).addClass('up'); | |
$(this).data('up', 1); | |
} | |
}); | |
}) | |
</script> | |
<style type="text/css"> | |
.av-options{height:100px; background:red;} | |
.av-options a{ display:block; height:100px;} | |
</style> | |
</head> | |
<body> | |
<div class="av-options"> | |
<a class="down">aaaaaaaaaa</a> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment