小编Thi*_*ter的帖子

jQuery在焦点上一次显示一个TD

我有一个我的网站的注册表单,我正在尝试向用户显示不同的隐藏td作为提示,当他们专注于输入时......

我已经尝试了最近的(),下一个(),兄弟(),hasClass()并且无法让这个东西工作......任何帮助都表示赞赏.这是jsfiddle http://jsfiddle.net/88JPU/1/

<style type="text/css" rel="stylesheet">
.focusField{  
    border:solid 2px #333;  
    background:lightyellow;   
}  
.idleField{  
     background:#fff;  
     border: solid 1px #DFDFDF;  
}  
input.text_field {
    -moz-border-radius: 5px 5px 5px 5px;
    border: 1px solid #DDDDDD;
    font-size: 14px;
    margin: 0;
    padding: 8px;
    width: 200px;
}
input.text_field.with_box {
    -moz-border-radius-bottomright: 0;
    -moz-border-radius-topright: 0;
}
.col-help {
    background:#f7f7f7;
    border:1px solid #ccc;
    font-size:13px;
    font-family:Tahoma, Geneva, sans-serif
}
</style>

<script>
$(function() {
    $('.col-help').hide();

    $('input[type="text"]').focus(function () {
        $(this).removeClass("idleField").addClass("focusField");
        $(this).closest('td').hasClass('col-help').show();
    });
});
</script>

<table>
<tbody>
<tr>
  <td>Full Name:</td>
  <td><input type="text" class="text_field name" id="name"/></td> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

0
推荐指数
1
解决办法
376
查看次数

在C中使用fopen命令的初学者很难

我正在关注C编程教程http://www.cprogramming.com/tutorial/c/lesson10.html.这个特殊的教程用C语言教文件I/O; 特别是,讨论了fopen命令.有一次,他们给出了以下示例(我认为应该打印文件test.txt的内容):

FILE *fp;
fp=fopen("c:\\test.txt", "w");
fprintf(fp, "Testing...\n");
Run Code Online (Sandbox Code Playgroud)

因此,我创建了一个名为test.txt的文本文件,并将其保存在我当前的工作目录中(C:\ cygwin\home\Andrew\cprogramming).然后我在同一目录中创建了ac文件,它包含以下代码:

#include <stdio.h>

int main()
{
  FILE *fp;
  fp=open("test.txt","w");
  fprintf(fp,"Testing...\n");
}
Run Code Online (Sandbox Code Playgroud)

当我使用gcc编译这个c文件(我称之为helloworld2.c)时,我收到以下消息:

helloworld2.c: In function `main':
helloworld2.c:40: warning: assignment makes pointer from integer without a cast
Run Code Online (Sandbox Code Playgroud)

然后,当我尝试运行可执行文件时,我得到:

Segmentation fault (core dumped)
Run Code Online (Sandbox Code Playgroud)

你对我接下来应该尝试什么有什么想法吗?

非常感谢您的宝贵时间.

c fopen

0
推荐指数
1
解决办法
2367
查看次数

数组中的整数索引增量

我在下面的片段中有一个疑问.实际上我在下面的代码中将所有数组索引初始化为零,但是这个for循环是无限的.我发现我们正在尝试访问数组的第26个索引,因此该值会再次初始化为零,因为有0到25个索引.所以for循环是无限的.解释一下这个东西背后的实际原因.

int array[26];
int i; 
for (i = 0; i <= 26; i++) 
    array[i]= 0;
Run Code Online (Sandbox Code Playgroud)

c arrays integer loops for-loop

0
推荐指数
1
解决办法
1771
查看次数

解析错误:语法错误,意外'{',期待'('帮忙?

我正在尝试为快速引擎制作一个照片库插件,但它给了我这个错误,一切似乎都关闭了.有帮助吗?

$whats_gonna_happen=$_GET['pictures'];

class upload_pictures
{
    public function upload_pictures
    {
        if (!isset($whats_gonna_happen))
        {
            $uploads='';
            $cout=1;
            $stuff=$this->EE->db->query('SELECT id, name FROM albums');
            $albums_list='';
            while ($row=$stuff->result_array())
            {
                $albums_list .= "<option value=" . $row[0] . ">" . $row[1] . "</option>\n";
            }  
            mysql_free_result($stuff);
            echo '
            <html>
                <head><title>Pictures upload</title></head>
                <body>
                    <form enctype="multipart/form-data" action="upload_page.php?pictures=1" method="POST" name="stough">
                        <table width="90%" border="0" align="center" style="width: 90%">
                            <tr><td>
                                Choose album : 
                                <select name="albums">
                                ' . $albums_list . '
                                </select>
                            </td></tr>
                            <tr><td>
                                <br /> photo : <br />
                                <input type="file" name="filename"  />
                            </td></tr>
                            <tr><td> …
Run Code Online (Sandbox Code Playgroud)

php parse-error

0
推荐指数
1
解决办法
687
查看次数

使用C中的指针进行字符串连接!

我使用C中的指针编写了以下代码用于字符串连接

#include<stdio.h> 
#include<stdlib.h>
#include<string.h>
void strCat(char *str1,char *str2);
int main(void)
{
char str1[] = "Rohit";
char str2[] = "Kumar";  
strCat(str1,str2);
return 0;
}

void strCat(char *str1,char *str2)
{
int i;
char *start;
start = str1;
printf("%s",str1);
while(*str1++ != '\0')
    continue;
while(*str2 != '\0')
    *str1++ = *str2++;
*str1 = '\0';

printf("%s\n",str1);
}
Run Code Online (Sandbox Code Playgroud)

为什么输出是Rohit(null).请帮忙!!

c pointers

0
推荐指数
1
解决办法
4023
查看次数

无法推送到github网站

我试图在github上使用Jekyll但似乎无法推动更新文件.我是git的新手,没有问题推动我做的回购,但当我试图推送到我的网站时,我不断收到这些错误:

你无法推动git://github.com/anthonybrown/anthonybrown.github.com.git
使用git@github.com:anthonybrown/anthonybrown.github.com.git

我一直试图这样做3天,然后翻页.

git

0
推荐指数
1
解决办法
851
查看次数

为什么我的int变量值会突然跳转?

// a cursor variable, for positioning purposes
int cursor = 0;

// declare a counter
int counter = 0;

// start a loop
while (counter <= 0)
{
    // get the cursor positioned correctly
    fseek(fp, cursor, SEEK_SET);

    // read the file and search for the jpeg key
    JPG_KEY key;
    fread(&key, sizeof(JPG_KEY), 4, fp);

    // check the key to see if you are at the start of a jpeg
    if( check_jpg_key(key) )
        counter++;

    cursor++;
}
Run Code Online (Sandbox Code Playgroud)

出于某种原因,我的"光标"和"计数器"变量在这个程序的中间跳转到可笑的高位,而不是在每个循环中递增1.使用gdb,我发现光标的值从0跳到2099202,并且计数器的值在此行从0跳转到3419700:fread(&key,sizeof(JPG_KEY),4,fp);

为什么?

c int

0
推荐指数
1
解决办法
908
查看次数

如何在python中使用set时隐藏输出中的'set'关键字

好的,我在python中有两个列表

a = ['bad', 'horrible']
b = ['bad', 'good']
Run Code Online (Sandbox Code Playgroud)

我正在使用set运算符来比较两个列表,并在两个集合之间存在一个常用词时给出输出.

print set(a) & set (b)
Run Code Online (Sandbox Code Playgroud)

这给出了输出,

set(['bad'])
Run Code Online (Sandbox Code Playgroud)

有没有在输出中删除关键字'set'?

我希望输出看起来像

['bad']
Run Code Online (Sandbox Code Playgroud)

python comparison set python-2.x

0
推荐指数
1
解决办法
323
查看次数

Python有内联语句吗?

python有类似于inlineC的东西吗?

如果没有,我怎样才能加快功能的执行?

python inline

0
推荐指数
1
解决办法
226
查看次数

学习更高级的JavaScript

为了学习JavaScript,我正在关注w3schools网站.

任何人都可以为我提供更有效的学习网站吗?

javascript

0
推荐指数
1
解决办法
4722
查看次数

标签 统计

c ×4

javascript ×2

python ×2

arrays ×1

comparison ×1

fopen ×1

for-loop ×1

git ×1

inline ×1

int ×1

integer ×1

jquery ×1

loops ×1

parse-error ×1

php ×1

pointers ×1

python-2.x ×1

set ×1