jQuery重要问题 [英] jquery important question

查看:72
本文介绍了jQuery重要问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有一个带一个按钮和一个标签的中继器
当您单击按钮时,标签的值会随着时间增加(每行).
首先在数据库中该值将增加,然后将出现在标签中(每行).
我的代码是这样的:

hello
I have a repeater that conatins one button and one label
when you click on button the value of label increases on time( for each row ).
first in database the value will be increased then will appear in label ( for each row ).
my code is like this:

$(document).ready(function () {
    $('a[id*=button]').click(function () {
        var panel = $(this).parent().find('div[id*=effect]');
        if (panel.css('display') == 'none') {
            $.post("ghInsertInsViewCount.ashx", $("form").serialize(), insertCallback);
            panel.fadeToggle("slow", "linear");
            $(this).html('<img src=images/Close.png />');
        }
        else if (panel.css('display') == 'block') {
            panel.fadeToggle("slow", "linear");
            $(this).html('اطلاعات بیشتر<img src=images/down-icon.png />');
        }
        return false;
    });
});

function insertCallback(result) {
    $('aViewCount').html(result);
}


我的问题是,当我单击按钮时,标签的值将更改并且所有行均相等
非常感谢


my problem is when I click on button the value of labels will be changed and equal for all rows
Thanks a lot

推荐答案

(文档).ready(函数(){
(document).ready(function () {


(' a [id * =按钮]').click(功能(){ var 面板=
('a[id*=button]').click(function () { var panel =


( this ).parent(). find(' div [id * = effect]'); 如果(panel.css(' display')== ' 没有'){
(this).parent().find('div[id*=effect]'); if (panel.css('display') == 'none') {


这篇关于jQuery重要问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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