themes/springy/js/navi.js
author Dan
Fri, 29 May 2009 14:36:23 -0400
changeset 1 deac853bf428
parent 0 faec06138933
permissions -rw-r--r--
Updated to 1.1.6 compatibility
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     1
var setpos_sidebar_right = function()
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     2
{
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     3
  if ( IE )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     4
    var top = getScrollOffset();
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     5
  else
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     6
    var top = 0;
1
deac853bf428 Updated to 1.1.6 compatibility
Dan
parents: 0
diff changeset
     7
  top += ( IE ? 4 : $dynano('right-sidebar-trigger').Top() ) + $dynano('right-sidebar-trigger').Height();
0
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     8
  var thediv = document.getElementById('right-sidebar');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
     9
  thediv.style.position = ( IE ) ? 'absolute' : 'fixed';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    10
  thediv.style.top = top + 'px';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    11
  thediv.style.right = '4px';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    12
}
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    13
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    14
addOnloadHook(setpos_sidebar_right);
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    15
window.onscroll = setpos_sidebar_right;
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    16
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    17
function sidebar_right_open()
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    18
{
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    19
  setpos_sidebar_right();
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    20
  var thediv = document.getElementById('right-sidebar');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    21
  thediv.style.display = 'block';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    22
  var trigger = document.getElementById('right-sidebar-trigger');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    23
  for ( var i = 0; i < trigger.childNodes.length; i++ )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    24
  {
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    25
    if ( trigger.childNodes[i].tagName == 'A' )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    26
    {
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    27
      trigger.childNodes[i].firstChild.nodeValue = 'hide navigation';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    28
      break;
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    29
    }
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    30
  }
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    31
  if ( getWidth() < 1084 )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    32
  {
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    33
    // small window, so move the main divs over to the left to make use of that padded area
1
deac853bf428 Updated to 1.1.6 compatibility
Dan
parents: 0
diff changeset
    34
    $dynano('mainholder').object.style.margin = '0';
0
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    35
  }
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    36
}
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    37
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    38
function sidebar_right_close()
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    39
{
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    40
  var thediv = document.getElementById('right-sidebar');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    41
  thediv.style.display = 'none';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    42
  var trigger = document.getElementById('right-sidebar-trigger');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    43
  for ( var i = 0; i < trigger.childNodes.length; i++ )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    44
  {
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    45
    if ( trigger.childNodes[i].tagName == 'A' )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    46
    {
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    47
      trigger.childNodes[i].firstChild.nodeValue = 'show navigation';
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    48
      break;
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    49
    }
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    50
  }
1
deac853bf428 Updated to 1.1.6 compatibility
Dan
parents: 0
diff changeset
    51
  $dynano('mainholder').object.style.margin = '0 auto';
0
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    52
}
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    53
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    54
function sidebar_right_toggle()
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    55
{
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    56
  var thediv = document.getElementById('right-sidebar');
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    57
  if ( thediv.style.display != 'block' )
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    58
    sidebar_right_open();
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    59
  else
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    60
    sidebar_right_close();
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    61
}
faec06138933 First commit. Almost ready for a first beta.
Dan
parents:
diff changeset
    62