Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Horizontal animation basically working now

  • Loading branch information...
commit f015db8e093dbe9bf4e4230fe6fbefaa1221e199 1 parent 8512a2f
@nathanl authored
Showing with 3 additions and 15 deletions.
  1. +1 −3 examples/example.css
  2. +2 −12 jquery.persistentpanel.js
View
4 examples/example.css
@@ -1,8 +1,7 @@
/* TODO: Fix CSS! Height is broken on panels; panels and code overlapping */
-html, body{background: #444; color: white; font-face: arial;}
+html, body{background: #444; color: white; font-face: arial; padding: 10px;}
div.panel {
width: 150px;
- height: 150px;
padding: 10px;
margin: 10px;
background-color: #225;
@@ -10,7 +9,6 @@ div.panel {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
}
-/* .panelToggler {margin: 5px; padding: 2px;} */
.panelToggler.closed {color: #555;}
#panel3wrapper, {position: absolute;}
View
14 jquery.persistentpanel.js
@@ -177,18 +177,8 @@
// Determine opposite direction of openDirection
var dir = settings.openDirection === 'left' ? 'right' : 'left';
// Default mode will be to slide the panel off screen and back on,
- // leaving the toggler visible. We need to know the panel's width, the
- // toggler's width, and the margin and padding at the edge of the page.
- var togglerWidth = $(settings.toggler).outerWidth(true);
- // TODO: Make this take into account all measurements that I know are
- // relevent - body and html margin and padding.
- var documentMargin = parseInt($(this).closest('body').css('margin-' + dir),10);
- // Not correct yet. Trying to move the panel past its own left margin,
- // border and padding (thus the outerwidth minus the plain width,
- // divided by 2 to get one side only), and past the document
- // padding/margin on one side, and past the plain width of the panel
- // EXCEPTING the toggler's width. Something is wrong, though.
- var dist = 0 - ((($(this).outerWidth(true) - $(this).width()) / 2) + ($(this).width() - togglerWidth) + documentMargin);
+ // leaving the toggler visible.
+ var dist = 0 - ($(this).outerWidth(true) - (($(this).outerWidth(true) - $(this).width()) / 2) - $(settings.toggler).outerWidth(true));
console.log('dist is ' + dist);
var animationOpts = {};
animationOpts[dir] = dist + 'px';
Please sign in to comment.
Something went wrong with that request. Please try again.