【发布时间】:2013-08-27 15:27:00
【问题描述】:
我有一个 JQuery (v1.8),它在单击超链接后处理代码。我想调用该单击或执行其他任何操作(如单击链接那样)以强制 JQuery 从后面的代码运行。有什么想法吗?
JQuery 代码:
<script type="text/javascript">
jQuery(document).ready(function (){
jQuery('#lnkShowModule').toggle(
function (){
jQuery(this).html('Hide the Module');
jQuery('.hide-element').toggle();
},
function (){
jQuery(this).html('Show the Hidden Module');
jQuery('.hide-element').toggle();
}
);
});
这是我在 ascx 控件中的链接:
<a id="lnkShowModule" href="#"> show the hidden module</a>
有什么想法吗?
【问题讨论】:
-
你想做什么?以及为什么在代码隐藏中需要它,因为您知道必须单击哪个“a”才能对 jquery 函数进行分类?
-
@AhmedAlaaElDin 我想在另一个事件之后从 javascript 执行操作,即使用户没有点击链接。
标签: javascript jquery asp.net vb.net