8 // Cache of "correct" heights for unordered list objects used in submenus. Helps the animation routine know what height it's aiming for. |
8 // Cache of "correct" heights for unordered list objects used in submenus. Helps the animation routine know what height it's aiming for. |
9 var jBoxMenuHeights = new Object(); |
9 var jBoxMenuHeights = new Object(); |
10 |
10 |
11 // Blocks animations from running if there's already an animation going on the same object |
11 // Blocks animations from running if there's already an animation going on the same object |
12 var jBoxSlideBlocker = new Object(); |
12 var jBoxSlideBlocker = new Object(); |
|
13 |
|
14 // Switch to enable or disable jBox slide animation |
|
15 var jBox_slide_enable = true; |
13 |
16 |
14 // Speed at which the menus should slide open. 1 to 100 or -1 to disable. |
17 // Speed at which the menus should slide open. 1 to 100 or -1 to disable. |
15 // Setting this higher than 100 will cause an infinite loop in the browser. |
18 // Setting this higher than 100 will cause an infinite loop in the browser. |
16 // Default is 80 - anything higher than 90 means exponential speed increase |
19 // Default is 80 - anything higher than 90 means exponential speed increase |
17 var slide_speed = 80; |
20 var slide_speed = 80; |
91 } |
94 } |
92 |
95 |
93 // Called when user hovers mouse over a submenu |
96 // Called when user hovers mouse over a submenu |
94 function jBoxOverHandler(obj) |
97 function jBoxOverHandler(obj) |
95 { |
98 { |
|
99 if ( is_Safari ) |
|
100 alert('Safari and over'); |
96 // Random ID used to track the object to perform on |
101 // Random ID used to track the object to perform on |
97 var seed = Math.floor(Math.random() * 1000000); |
102 var seed = Math.floor(Math.random() * 1000000); |
98 jBoxObjCache[seed] = obj; |
103 jBoxObjCache[seed] = obj; |
99 |
104 |
100 // Sleep for a (little more than a tenth of a) second to see if the user really wants the menu to expand |
105 // Sleep for a (little more than a tenth of a) second to see if the user really wants the menu to expand |
133 var off = fetch_offset(obj); |
138 var off = fetch_offset(obj); |
134 var dimh = parseInt(dim['h']); |
139 var dimh = parseInt(dim['h']); |
135 var offtop = parseInt(off['top']); |
140 var offtop = parseInt(off['top']); |
136 var top = dimh + offtop; |
141 var top = dimh + offtop; |
137 left = off['left']; |
142 left = off['left']; |
|
143 if ( jBox_slide_enable ) |
|
144 { |
|
145 domObjChangeOpac(0, ul); |
|
146 } |
138 ul.style.left = left + 'px'; |
147 ul.style.left = left + 'px'; |
139 ul.style.top = top + 'px'; |
148 ul.style.top = top + 'px'; |
140 domObjChangeOpac(0, ul); |
|
141 ul.style.clip = 'rect(auto,auto,auto,auto)'; |
149 ul.style.clip = 'rect(auto,auto,auto,auto)'; |
142 ul.style.overflow = 'visible'; |
150 ul.style.overflow = 'visible'; |
143 ul.style.display = 'block'; |
151 ul.style.display = 'block'; |
144 slideOut(ul); |
152 if ( jBox_slide_enable ) |
|
153 { |
|
154 slideOut(ul); |
|
155 } |
|
156 else |
|
157 { |
|
158 domObjChangeOpac(100, ul); |
|
159 } |
145 } |
160 } |
146 } |
161 } |
147 |
162 |
148 function jBoxOutHandler(obj, event) |
163 function jBoxOutHandler(obj, event) |
149 { |
164 { |