This doesn't work?

function showHide(elementID)
{
        if ( document.getElementById(elementID).style.display == 'block' )
        { document.getElementById(elementID).style.display = 'none'; }
        else
        { document.getElementById(elementID).style.display = 'block'; }
}

-----Original Message-----
From: Dave Lyons [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 03, 2006 2:49 AM
To: CF-Talk
Subject: js problem in safari

the following code works in pretty much all the browsers except Safari. All
it is a show/hide layers on link click, anyone have any suggestions?

<cfsavecontent variable="showjs">
<cfoutput>
<script type="text/JavaScript">
<!--
function pv(obj,cP,jP){
        if(typeof(obj)!='object'){var obj=document.getElementById(obj);}
        if(typeof(obj.currentStyle)!='object'){
                return (typeof(document.defaultView)=='object')?
        
document.defaultView.getComputedStyle(obj,'').getPropertyValue(cP):
                obj.style.getPropertyValue(cP);}
        else{
                return (navigator.appVersion.indexOf('Mac')!=-1)?
                obj.currentStyle.getPropertyValue(cP):
                obj.currentStyle.getAttribute((jP)?jP:cP);}
}

function toggleIt(){
        var
obj,cS,args=toggleIt.arguments;document.MM_returnValue=(typeof(args[0].href)
!='string')?true:false;
        for(var i=1;i<args.length;i++){obj=document.getElementById(args[i]);
                if(obj){cS=pv(obj,'display');
        
if(!obj.jw_OD){obj.jw_OD=(cS!='none'&&cS!='')?cS:(obj.tagName.toUpperCase()=
='TR' && cS!=='none')?'':
                        (obj.tagName.toUpperCase()=='TR' &&
typeof(obj.currentStyle)!='object')?'table-row':'block';}
                        obj.style.display=(cS!='none')?'none':obj.jw_OD}}
}
//-->
</script>
</cfoutput>
</cfsavecontent>

<cfhtmlhead text="#showjs#">

<cfloop query="getFaqs">
                <cfif not isdefined("thisCount")>
                <cfset thisCount = 1>
                <cfelse>
                <cfset thisCount = thisCount + 1>
                </cfif>
                
                <p class="pcenter"><a href="javascript:;"
onclick="toggleIt(this,'sh#thisCount#');return
document.MM_returnValue">#getFaqs.jtbl_question#</a><br /><span
id="sh#thisCount#" style="display:none;">#getFaqs.jtbl_answer#</span></p>
</cfloop>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255136
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to