Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/08/2010, 15:08
hardvin
 
Fecha de Ingreso: enero-2010
Ubicación: Colombia
Mensajes: 6
Antigüedad: 14 años, 3 meses
Puntos: 0
De acuerdo Respuesta: cerrar acordeon al iniciar la pagina jquery

Despues de crear el acordeon agrega esta linea de codigo


$('#link1').trigger('click');


Diciendo que link1 es el ID del hypervinculo que tienes en el primer item del accordion que tienes abierto



Amo Jquery ;) espero que te sirva ... aca un codigo de ejemplo


En el head tengo

Código:
	<script type="text/javascript">
	$(function() {
		$("#accordeon").accordion({
			collapsible: true
		});
		$('#link1').trigger('click');
	});
	</script>

En el boddy esta seria la estructura del accordeon

ensaya y me cuentas


Código:
<div id="accordeon">
	<h3><a id="link1" href="#">Agregar Nuevo Grupo</a></h3>
	<div style="text-align: center">

<table style="width: 582px">
    <tr>
        <td colspan="2" style="height: 21px; text-align: center">
            <asp:Label ID="Label11" runat="server" Text="INGRESE LOS SIGUIENTES DATOS "></asp:Label></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="lblGrupo" runat="server" Text="Nombre del Grupo (*)" Width="184px"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtNomgrupo" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label2" runat="server" Text="Descripcion Generica 1" Width="157px"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtGen1" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label3" runat="server" Text="Descripcion Generica 2"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtGen2" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label4" runat="server" Text="Descripcion Generica 3"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtGen3" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right; height: 21px;">
            <asp:Label ID="Label5" runat="server" Text="Descripcion Generica 4"></asp:Label></td>
        <td style="width: 315px; height: 21px;">
            <asp:TextBox ID="txtGen4" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label6" runat="server" Text="Descripcion Generica 5"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtGen5" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label7" runat="server" Text="Descripcion Generica 6"></asp:Label></td>
        <td style="width: 315px">
            <asp:TextBox ID="txtGen6" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; height: 21px; text-align: right">
            <asp:Label ID="Label8" runat="server" Text="Descripcion Generica 7"></asp:Label></td>
        <td style="width: 315px; height: 21px">
            <asp:TextBox ID="txtGen7" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label9" runat="server" Text="Descripcion Generica 8"></asp:Label></td>
        <td style="width: 315px; text-align: left;">
            <asp:TextBox ID="txtGen8" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; height: 21px; text-align: right">
            <asp:Label ID="Label10" runat="server" Text="Descripcion Generica 9"></asp:Label></td>
        <td style="width: 315px; height: 21px; text-align: left;">
            <asp:TextBox ID="txtGen9" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="width: 274px; text-align: right">
            <asp:Label ID="Label1" runat="server" Text="Descripcion Generica 10"></asp:Label></td>
        <td style="width: 315px; text-align: left;">
            <asp:TextBox ID="txtGen10" runat="server" Width="304px"></asp:TextBox></td>
    </tr>
    <tr>
        <td colspan="2" style="height: 21px; text-align: center">
            <asp:Button ID="btnGuardar" runat="server" Text="Guardar" OnClick="btnGuardar_Click" />
        </td>
    </tr>
</table>
</div>
</div>

Fijate muy bien en el Punto clave del segundo codigo



Código:
<div id="accordeon">
	<h3><a id="link1" href="#">Agregar Nuevo Grupo</a></h3>
ahi le coloco el ID del que quiero mandarle el clic via JQuery

Espero haberte ayudado