Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function() {
- $("#footer").dblclick(showStatusBar);
- });
- function showStatusBar() {
- var footer = $("#footer");
- footer.unbind('dblclick', showStatusBar);
- footer.animate({ height: "100px" }, 200);
- footer.dblclick(hideStatusBar);
- footer.bind('mouseleave', hideStatusBar);
- }
- function hideStatusBar() {
- var footer = $("#footer");
- footer.unbind('mouseleave', hideStatusBar);
- footer.unbind('dblclick', hideStatusBar);
- footer.animate({ height: "11px" }, 200);
- footer.dblclick(showStatusBar);
- }
- </script>
- // NOTE: Untested!
- function statusBarToggle() {
- /* Starts as hidden. */
- if(this.isHidden == undefined)
- this.isHidden = true;
- this.isHidden = !this.isHidden;
- var newHeight = this.isHidden ? 11 : 200;
- $(this)
- .stop()
- .animate({ height: newHeight + 'px' }, 200);
- /* When mouse leaves open status bar, close it. */
- if(this.isHidden)
- $(this).unbind('mouseleave', statusBarToggle);
- else
- $(this).bind('mouseleave', statusBarToggle);
- }
- $(document).ready(function() {
- // ...
- $('#footer').dblclick(statusBarToggle);
- }
Add Comment
Please, Sign In to add comment