来自分号txt文件的javascript。涉及到同一行的记录。一个创建悬停,另一个显示 [英] javascript from a semicolon txt file. involving to records in the same row. One that creates the hover and the other to show
问题描述
我开始在这个水深处游泳,现在已经超出我的头了......
我的情况......
这是我的jquery代码,用于突出显示一行....
< script type =text / javascript>
$(tr)。not(':first')。悬停(
function(){
$(this).css(background,#d3d3d3);
},
function(){
$(this).css(background,);
}
);
< / script>
当它悬停时我想在第4列和第5列显示一条记录显示在标题中。
到目前为止我一直在使用php来做这个,但我不确定php是否是我想要的方式...
这是我的PHP抓取记录并创建表....
$ row = 1;
if(($ handle = fopen($ statfile,r))!== FALSE){
echo'';
while(($ data = fgetcsv($ handle,1000,;))!== FALSE){
if( substr($ data [0],0,3)!='HDR'&& substr($ data [0],0,3)!='JOB')继续;
$ num = count($ data);
if(substr($ data [0],0,3)=='HDR'){
echo'';
}否则{
echo'';
}
for($ c = 1; $ c< = 4; $ c ++){
// echo $ data [$ C] 。 结果\\\
;
if(空($ data [$ c])){
$ value = ;
}否则{
$ value = trim($ data [$ c]);
}
if(substr($ data [0],0,3)=='HDR'){
echo'\ n;
}否则{
if($ c == 1){
echo' \ n;
}否则{
echo'\ n;
}
}
}
if(substr($ data [0],0,3)=='HDR'){
echo'';
}其他{
echo'';
}
$ row ++;
}
echo'
'。$ value。 | '.$value。 | '。$ value。 |
---|
fclose($ handle);
}
?>
到目前为止一切正常,它在表格中显示我的信息,可排序的类对它进行排序......
PWR 9; #00FF00;
PWR 10; #00FF00;
PWR 11; #FF0000;
HDR 0;会议;用户;域名;电子时间;主持人;设计;路径;
JOB 1; 122:1;好的; 6;时间00:22:42 158.140.43.151; ixdiag_model_bedb; / home / hupcey / diags
JOB 2; 121:1;加泽拉诺; 2; 00:10:42; 158.140.43.151; ixdiag_model_bedb; / home / hupcey / diags
我在JOB索引中,当你将鼠标悬停在行上时我希望显示IP ...
我吠叫正确的树吗?
有人可以帮助我或指责吗?我感谢你对此事的任何帮助。
William
Hi, I started swimming waste deep in this water and now it's over my head...
My situation...
Here is my jquery code to highlight a row....
<script type="text/javascript">
$("tr").not(':first').hover(
function () {
$(this).css("background","#d3d3d3");
},
function () {
$(this).css("background","");
}
);
</script>
When it hovers I want to show a record in columns 4 and 5 to appear in the header.
I've been using php to do this so far but I'm not sure if php is the way I want to go for this...
Here is my php to grab the records and create the table....
$row = 1;
if (($handle = fopen($statfile, "r")) !== FALSE) {
echo '';
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
if (substr($data[0],0,3)!='HDR' && substr($data[0],0,3) != 'JOB' ) continue;
$num = count($data);
if (substr($data[0],0,3)=='HDR') {
echo '';
}else{
echo '';
}
for ($c=1; $c <= 4; $c++) {
//echo $data[$c] . "
\n";
if(empty($data[$c])) {
$value = " ";
}else{
$value = trim($data[$c]);
}
if (substr($data[0],0,3)=='HDR') {
echo '\n";
}else{
if ($c==1) {
echo '\n";
}else{
echo '\n";
}
}
}
if (substr($data[0],0,3)=='HDR') {
echo '';
}else{
echo '';
}
$row++;
}
echo '
'.$value." | '.$value." | '.$value." |
---|
fclose($handle);
}
?>
So far everything works it displays my info in the table, the sortable class sorts it...
PWR 9 ; #00FF00 ;
PWR 10 ; #00FF00 ;
PWR 11 ; #FF0000 ;
HDR 0 ; Session ; User ; Domains ; E-Time ; Host ; Design ; Path ;
JOB 1 ; 122:1 ; hupcey ; 6 ; 00:22:42 ; 158.140.43.151 ; ixdiag_model_bedb ; /home/hupcey/diags
JOB 2 ; 121:1 ; galzerano ; 2 ; 00:10:42 ; 158.140.43.151 ; ixdiag_model_bedb ; /home/hupcey/diags
I'm in the JOB index and I want the IP to show up when you hover over the row...
Am I barking up the right tree?
Can someone help me or point a finger? I appreciate any help on this matter.
William
推荐答案
(tr)。not(':first')。hover(
function(){
("tr").not(':first').hover(
function () {
(this).css(background,#d3d3d3);
},
function(){
(this).css("background","#d3d3d3");
},
function () {
(this).css(background,);
}
);
< / script>
当它悬停时我想在第4列和第5列显示一条记录显示在标题中。
到目前为止我一直在使用php来做这个,但我不确定php是否是我想要的方式...
这是我的PHP抓取记录并创建表....
(this).css("background","");
}
);
</script>
When it hovers I want to show a record in columns 4 and 5 to appear in the header.
I've been using php to do this so far but I'm not sure if php is the way I want to go for this...
Here is my php to grab the records and create the table....
这篇关于来自分号txt文件的javascript。涉及到同一行的记录。一个创建悬停,另一个显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!