// sample solution to panel.js
var ANIMATION_LENGTH = 300;
$(document).ready(function(){
var $panel = $("#panel");
var $tab = $("#tab");
$tab.click(function(){
//console.log("tab clicked");
var isShown = ($panel.css("top")==="0px");
var newTop = (isShown) ? "-180px": "0px";
//$panel.css("top",newTop);
$panel.animate({"top":newTop},ANIMATION_LENGTH);
});
});
No comments:
Post a Comment