songtianbao 发表于 2013-1-22 22:08:43

为GridView每个单元格鼠标移上去显示div

这里读的是xml,大家可以参照自己的读取方式将数据转换成表格.gridview 的RowBound事件里面的内容
<div style="padding-right: 5.4pt; padding-left: 5.4pt; background: #e6e6e6; padding-bottom: 4px; width: 95%; padding-top: 4px;">http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif//鼠标经过时候显示div
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.giffunctionshowdivByCs(table)...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//table=table.replace("&","&");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//table=table.replace(">",">");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//table=table.replace("<","<");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//table=table.replace(""",""");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//table=table.replace("'","'");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifvarx=window.event.x;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifvary=window.event.y;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifvarshow=document.getElementById("ShowInfo");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.visibility="visible";
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.top=y;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.left=x;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.background="#ffff00";
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//读取xml
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifdocument.getElementById("sp").innerHTML=table;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif//div跟随鼠标
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifdocument.onmousemove=moveToMouseLoc;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif//鼠标移动时候div跟随
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.giffunctionmoveToMouseLoc(e)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifx=window.event.x;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gify=window.event.y;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifvarshow=document.getElementById("ShowInfo");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.left=x;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifshow.style.top=y;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifreturntrue;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
页: [1]
查看完整版本: 为GridView每个单元格鼠标移上去显示div