вызов функции jquery внутри ретранслятора. Проблема я хочу переключить div, когда нажимаем на ссылку. Я думаю, что не первая функция jquery с этим случаем. Я думаю, что также зонд из таблицы между div и ссылкой.Вызов функции JQuery внутри репитера
function toggleMe() {
$(function() {
$('.toggler').on('click', function (ev) {
$(this).next('.dataContentSection').toggle();
});
});
}
<div id="repeater"><div class="dataContentSection">
<div>Name</div>
</div>
<table>
<tr>
<td>
<asp:LinkButton class="titleText toggler" OnClientClick="javascript:toggleMe(); return false;" runat="server">+ Address details</asp:LinkButton>
<asp:Label ID="Label1" runat="server" Text="Welcome"></asp:Label>
</td>
</tr>
</table>
<div class="dataContentSection" style="display: none;">
<div>Address Line 1:</div>
<div>Address Line 2:</div>
<div>Address Line 3:</div>
</div>
<div class="dataContentSection">
<div>Name</div>
</div>
<table>
<tr>
<td>
<asp:LinkButton class="titleText toggler" OnClientClick="javascript:toggleMe(); return false;" runat="server">+ Address details</asp:LinkButton>
<asp:Label ID="Label2" runat="server" Text="Welcome"></asp:Label>
</td>
</tr>
</table>
<div class="dataContentSection" style="display: none;">
<div>Address Line 1:</div>
<div>Address Line 2:</div>
<div>Address Line 3:</div>
</div>
<div class="dataContentSection">
<div>Name</div>
</div>
<table>
<tr>
<td>
<asp:LinkButton class="titleText toggler" OnClientClick="javascript:toggleMe(); return false;" runat="server">+ Address details</asp:LinkButton>
<asp:Label ID="Label3" runat="server" Text="Welcome"></asp:Label>
</td>
</tr>
</table>
<div class="dataContentSection" style="display: none;">
<div>Address Line 1:</div>
<div>Address Line 2:</div>
<div>Address Line 3:</div>
</div>
<div class="dataContentSection">
<div>Name</div>
</div>
<table>
<tr>
<td>
<asp:LinkButton class="titleText toggler" OnClientClick="javascript:toggleMe(); return false;" runat="server">+ Address details</asp:LinkButton>
<asp:Label ID="Label4" runat="server" Text="Welcome"></asp:Label>
</td>
</tr>
</table>
<div class="dataContentSection" style="display: none;">
<div>Address Line 1:</div>
<div>Address Line 2:</div>
<div>Address Line 3:</div>
</div>
<div class="dataContentSection">
<div>Name</div>
</div>
<table>
<tr>
<td>
<asp:LinkButton class="titleText toggler" OnClientClick="javascript:toggleMe(); return false;" runat="server">+ Address details</asp:LinkButton>
<asp:Label ID="Label5" runat="server" Text="Welcome"></asp:Label>
</td>
</tr>
</table>
<div class="dataContentSection" style="display: none;">
<div>Address Line 1:</div>
<div>Address Line 2:</div>
<div>Address Line 3:</div>
</div>
</div>
В чем вопрос? – atmd
Итак, чего вы хотите достичь? Когда я нажимаю «Адресные данные», ссылка должна открыться? Пожалуйста, сообщите нам правильные данные – BNN
, когда я нажимаю на ссылку, открываю div. – boshkash