Click here to Skip to main content
16,012,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,
this is my code
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
$('#dispframe').click(function ()
{
$('#iFrameWin').toggle();
$('#Button3').text="-"

});
<iframe
id="I1" frameborder="0" vspace="0" hspace="0"
marginwidth="0" marginheight="0"
scrolling="yes" src="AssignToCompany.aspx" name="I1"
style="width: 672px; height: 210px">

</iframe>





<asp:Button ID="dispframe" runat="server" Text="Button" Width="108px" />








it toggles perfectly but what i need is when the frame is expanded i need the - thing to be displayed and when the frame is compressed i need the + to be displayed how to i do it .
Posted

1 solution

hope this helps you.
<style type="text/css"> 
.buttonCollapse 
{ 
        
        text-align: center; 
        border: 2px solid #007CB9; 
        height: 15pt; 
        vertical-align: middle; 
        cursor: pointer; 
        cursor: hand; 
        

}</style> 
    <script type="text/jscript"> 
    function showHideDiv() 
    { 
    
        var divstyle = new String(); 
        divstyle = document.getElementById("dvDisplay").style.display; 
        if(divstyle.toLowerCase()=="block" || divstyle == "") 
        { 
           
            document.getElementById("dvDisplay").style.display = 'none'; 
             document.getElementById("btnDisplay").value = '+'; 
    
        } 
        else 
        { 
          
            document.getElementById("dvDisplay").style.display = 'block'; 
              document.getElementById("btnDisplay").value = '-'; 
        } 
        
    } 
    </script> 

 
<body> 
    <form id="form1"  runat="server"> 
    <div> 
         <input id="btnDisplay"  runat="server" type="button" class="buttonCollapse"  önclick="showHideDiv()">
                        value="-" /> 
                    
                <div id="dvDisplay"  runat="server" style="border-color:Black; background-color:Gray;"> 
                
                Content of the division....... 
                  </div> 
    </input></div> 
    </form> 
</body>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900