switchmenuframe so umgeschrieben dass es keine fehler wirft
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 31 Aug 2012 10:12:11 +0000 (12:12 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 17 Oct 2012 13:51:17 +0000 (15:51 +0200)
js/switchmenuframe.js

index ec22426..055a7d9 100644 (file)
@@ -1,17 +1,15 @@
 var vSwitch_Menu = 1;
-var FrameSize = (parent.document.getElementById('menuframe').cols);
+var Frame;
+var FrameSize;
 
-function Switch_Menu()
-{
-    if (vSwitch_Menu)
-    {
-        vSwitch_Menu=false;
-                parent.document.getElementById('menuframe').setAttribute('cols','30,*');
-    }
-    else
-    {
-        vSwitch_Menu=true;
-                parent.document.getElementById('menuframe').setAttribute('cols',FrameSize);
-    }
-    return;
+function Switch_Menu() {
+  if (Frame) {
+    Frame.attr('cols',vSwitch_Menu ? '30,*' : FrameSize);
+    vSwitch_Menu=!vSwitch_Menu;
+  }
 }
+
+$(function(){
+  Frame = $(parent.document.getElementById('menuframe'));
+  FrameSize = Frame.attr('cols');
+})