在回发结束代码时防止扩展 [英] Prevent expand when firing back end code

查看:44
本文介绍了在回发结束代码时防止扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery折叠并在我的页面中展开一些div标签..



我的问题是如果我有一个崩溃的div我在后端代码中激活一个事件,页面刷新,div扩展......有没有人知道我该如何解决这个问题?



请注意我m使用asp.net和vb.net



i'm using jquery to collapse and expand a some div tags in my page..

my problem is that if i have a div that is collapsed and i fire an event in the back end code the page refreshes and the div expands... does anyone have any idea how can i fix this?

note that i'm using asp.net with vb.net

<div class="content-module-heading cf">
   <h3 class="fl">Table of content to send</h3>
   <span class="fr expand-collapse-text">Click to collapse</span>
   <span style="display: none;" class="fr expand-collapse-text initial-expand">Click to expand</span>
</div> 





jquery:





jquery:

 $(document).ready(function() {

//Content boxes expand/collapse
$(".initial-expand").hide();

$("div.content-module-heading").click(function(){
    $(this).next("div.content-module-main").slideToggle();

    $(this).children(".expand-collapse-text").toggle();
});

 });

推荐答案

document )。ready( function (){

// 内容框展开/折叠
(document).ready(function() { //Content boxes expand/collapse


.initial-expand)。hide();
(".initial-expand").hide();


div.content-module-heading)。click( function (){
("div.content-module-heading").click(function(){


这篇关于在回发结束代码时防止扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆