<script language="_javascript_" type="text/_javascript_">
function ShowMenu($sMenu){
var $aMenus = new Array();
$aMenus = ['submenu_reporting', 'submenu_forms', 'submenu_tickets'];
$aMenus.each(Element.hide)
if($sMenu != '') Element.show($sMenu);
}
</script>
<div class="toplinks"
style="width: 100%; font-size: 14px; font-weight: bold; border-bottom: 1px solid #000000;
background-color: #FFFFFF; height: 50px;" onMouseOut="ShowMenu('')">
<a href="http://sharepoint">Home</a> |
<a <?php if($_SERVER['PHP_SELF'] != '/rm5_reporting.php') echo 'href=""'?>
onMouseOver="ShowMenu('submenu_reporting')">
RM5 Reporting</a> |
<a <?php if($_SERVER['PHP_SELF'] != '/form_menu.php') echo 'href=""'?>
onMouseOver="ShowMenu('submenu_forms')">Forms</a> |
<a style="color: #000066" onMouseOver="ShowMenu('submenu_tickets')">Tickets</a>
<div id="submenu_tickets" style="display: none; border-top: solid 1px black">
<a href="/admin.php?sMode=Report">Open IT Tickets</a> |
<a href="/viewtickets.php">Open By User</a> |
<a href="/submitticket.php?catid=1">Computer</a> |
<a href="/submitticket.php?catid=2">Maintenance</a> |
<a href="/submitticket.php?catid=3">Face Sheets</a> |
</div>
<div id="submenu_reporting" style="display: none; border-top: solid 1px black">
<a href="/rm5_reporting.php?cboReport=Daily%20Patient%20Hours">Daily Patient Hours</a> |
<a href="/rm5_reporting.php?cboReport=Patient%20Info">Patient Info</a> |
<a href="/rm5_reporting.php?cboReport=Patient%20Logs">Patient Logs</a> |
<a href="/rm5_reporting.php?cboReport=Patients%20Due%20List">Patients Due List</a> |
<a href="/rm5_reporting.php?cboReport=Phase%203">Phase 3</a> |
<a href="/rm5_reporting.php?cboReport=Weekly%20Patient%20Schedule">WPS</a>
</div>
<div id="submenu_forms" style="display: none; border-top: solid 1px black">
<a href="/treatment_schedule.php">Treatment Schedule</a> |
<a href="/form_menu.php?sForm=ccr">Concurrent Review</a> |
<a href="/form_menu.php?sForm=fce">FCE</a> |
<a href="/form_menu.php?sForm=mhe">MHE</a>
</div>
</div>
-------------------------------------
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Siegfried Puchbauer
Sent: Thursday, October 19, 2006 7:56 AM
To: [email protected]
Subject: [Rails-spinoffs] Re: Using array.each with Element.hide
['submenu_reports', 'submenu_forms', 'submenu_tickets'].map($).invoke('hide');
cheers
You can also do:
$aMenus.each(Element.hide);
this way, each item of the array will get passed into a Element.hide
() call,
no need for the extra inline function definition.
Best,
Thomas
Am 19.10.2006 um 00:00 schrieb Keith Davis:
>
> Never mind. It was just a typo. It should have been
> submenu_reporting. Duh.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Christophe
> Porteneuve
> Sent: Wednesday, October 18, 2006 4:34 PM
> To: [email protected]
> Subject: [Rails-spinoffs] Re: Using array.each with Element.hide
>
>
> Hey Keith,
>
> First, you might want not to name your variables with leading $'s.
> It's
> not idiomatic JS. Basically, $-vars are the realm of PHP :-)
> Perusing your
> script a first time, I was confused as to the language context :-D
>
> Keith a écrit :
>> function ShowMenu($sMenu){
>>
>> var $aMenus = new Array();
>> $aMenus = ['submenu_reports',
> 'submenu_forms',
>> 'submenu_tickets'];
>
> First, you can put this in one line: your new Array() never gets used.
>
>> $aMenus.each( function($s){ Element.hide($s);
> })
>>
>> Element.show($sMenu);
>>
>> }
>>
>> The error I get it is style is null or not an object. If I swap out
>> Element.hide for alert, it works fine.
>
> Where do you get this? The final show line? Then we'd have to
> know what is
> being passed to your ShowMenu function... If it's in the anonymous
> function
> (hide calls), double-check the IDs in your array against the actual
> DOM of
> your page.
>
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
>
>
>
> >
--
Thomas Fuchs
wollzelle
http://www.wollzelle.com
questentier on AIM
madrobby on irc.freenode.net
http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 _javascript_
http://mir.aculo.us :: Where no web developer has gone before
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---
- [Rails-spinoffs] Re: Using array.each with Element.hid... Thomas Fuchs
- [Rails-spinoffs] Re: Using array.each with Elemen... Siegfried Puchbauer
- [Rails-spinoffs] Re: Using array.each with El... Keith Davis
- [Rails-spinoffs] Re: Using array.each with Elemen... Drew Taylor
- [Rails-spinoffs] Re: Using array.each with Elemen... Keith Davis
