你干错用 div+iframe 采用 onmouseover 事件,调用 Ajax 更新那个 div里面的iframe内容好了。

解决方案 »

  1.   

    有兴趣,可以去看看 Ext 的 tooltip 类。 感觉还不错。
      

  2.   

    为什么要用title显示啊,是想把title做成超链接吗?
    还是说把鼠标移到title上显示链接地址啊?
      

  3.   

    还是想把鼠标移动到超链接上显示链接到地址的title?
    确实用onmouseover就O了
      

  4.   

    title里面肯定不支持html了。
    还是用div来模拟吧。
      

  5.   


    这个用title无法放一个html页面的
    只有通过DIV来模拟当然除了DIV还有一种span的方法
      

  6.   

    DIV处理是比较好的
    span处理可能不怎么好看
    但是比较容易理解和易写
      

  7.   

    抢分阿<script>
    var titleType=1;//用哪种方式载入title。1/2:startDownload/iframe。startDownload,仅能使用在ie,且不支持跨域
    var hiddenType=1;//使用哪种方式隐藏title。1/2:当鼠标离开模拟的title时/当鼠标离开连接时
    var titleWidth=150;//title宽度
    var titleHeight=250;//title高度
    var titleObj;
    /*
    显示模拟title
    */
    function showTitle(titleId,url){
    var nowObj=document.getElementById(titleId);
    if(nowObj!=titleObj){
    if(titleObj){hiddenTitle();}
    titleObj=nowObj
    } if(titleObj.style.display!=''){
    titleObj.style.display='';
    }

    setTitle(); if(titleObj.style.display==''){
    if(hiddenType==1){
    titleObj.attachEvent("onmouseout",function(){if(titleObj.contains(event.fromElement)){hiddenTitle()}})
    }
    else if(hiddenType==2){
    event.srcElement.attachEvent("onmouseout",hiddenTitle)
    } getTitle(url);
    }
    }
    /*
    设置模拟title
    */
    function setTitle(){
    titleObj.style.position='absolute';
    titleObj.style.width=titleWidth+'px'
    titleObj.style.height=titleHeight+'px'
    titleObj.style.overflow='auto' var tmp_r_wh=JS_getFollowPlace(titleWidth,titleHeight);
    titleObj.style.top=tmp_r_wh[1]
    titleObj.style.left=tmp_r_wh[0];
    }
    /*
    获得title内容
    */
    function getTitle(url){
    if(titleType==1){
    oDownload.startDownload(url,putData)
    }
    else if(titleType==2){
    putData('<iframe  src="'+url+'" marginwidth="1" marginheight="1" scrolling="no" border="0" frameborder="0"></iframe>');
    }
    }
    /*
    输出html内容到模拟title中
    */
    function putData(data){ 
    titleObj.innerHTML=data 
    }
    /*
    隐藏模拟title
    */
    function hiddenTitle(){
    titleObj.style.display='none';
    }/*
    获得跟随位置
    */
    function JS_getFollowPlace(w,h)
    {
     var iX,iY
     if (window.event.x + w > document.body.offsetWidth - 10)
    {
    iX = window.event.x - w - 5 ;
    }
     else
    {iX = window.event.x + 5;}
     if (iX <0)  
    {iX=0;} iY = window.event.y;
     if (window.event.y + h > document.body.offsetHeight - 10 )
    {
    iY = document.body.scrollTop + document.body.offsetHeight - h - 5 ;
    }
     else
    {iY = document.body.scrollTop +window.event.y + 5; }
     if (iY <0)
    {
    iY=0;
    }
    return [iX,iY];
    }
    </script> 
    <IE:DOWNLOAD id="oDownload" style="behavior: url(#default#download)"></IE:DOWNLOAD><a href="###" onmouseover="showTitle('titleId','test.htm')">连接</a><!-- <a href="###" onmouseover="showTitle('titleId','http://www.baidu.com/')">连接</a>如果titleType=1 ,将不能跨域,无法获得非当前网站内的html文件 --><br><br><br><br><div id=titleId style="border: 2px solid #FF0000"></div>
      

  8.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【EnginePlus】截止到2008-06-26 17:44:12的历史汇总数据(不包括此帖):
    发帖数:11                 发帖分:758                
    结贴数:8                  结贴分:508                
    未结数:3                  未结分:250                
    结贴率:72.73 %            结分率:67.02 %            
    楼主加油
      

  9.   

    在高手后面跟一下.自己加个div就行了
      

  10.   

    你用smarty的么?
    smarty支持那个tooltip
      

  11.   

    啊  忘了说,要IE , Firefox, Opera都支持才行啊
      

  12.   

    function j_showHelpTip(type,id,tabletype){
    if ((event.clientY+280) < 500){
    $("#abc").css("top",(document.documentElement.scrollTop+event.clientY+10)+"px");
    }else{
    $("#abc").css("top",(document.documentElement.scrollTop+event.clientY-150)+"px");
    }
    if(showHelpValue==0){
    Polices(type,id,tabletype);
    $("#abc").slideDown("fast");
    showHelpValue ++;
    }
    $("#xy").html(event.clientX+','+event.clientY+','+document.getElementById("abc").offsetHeight+','+document.documentElement.scrollTop);
    isExe = 1;
    }function j_closeHelpTip(){
    if(showHelpValue==1){
    $("#abc").slideUp("fast");
    showHelpValue = 0;
    }
    }<div class="tipDiv" id="abc">
    <div class="tipContent"><span id="Polices_value"></span></div>
    </div><tr bgcolor="#DAE9F8" onclick="j_showHelpTip('0001',<!--{$accesslist.ID}-->,'a')" onmouseover="this.style.background='#CCFFCC';" onmouseout="this.style.background='#DAE9F8';j_closeHelpTip()" align="center">
      

  13.   

    title显示出来是另外一个HTML页面的链接?显示另外一个HTML页面?后者的话没用过title实现
      

  14.   

    又搜了一下
    发现一个源代码
    不过只支持IE和NN的 谁能修改一下变成也能支持FireFox和Opera啊 
    代码文件 index.htm 和 pophtm.jsindex.htm 代码如下:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <SCRIPT LANGUAGE=JavaScript src="pophtm.js"></SCRIPT>
    <script language="JavaScript"><!--
    if (IE4)
    {
        document.write('<div id=popLayer style="position:absolute; z-index:101" class=cPopText></div>');
        document.write('<div id=TipBox style="position: absolute; visibility: hidden; padding: 5px; background-Color: #ffffee; filter: alpha(Opacity=90); border: 1px dashed #0099FF; z-index: 99" onMouseover="keepTip()" onMousewheel="keepTip()" ></div>');
    }
    else if (NN4)
    {
        document.write('<div id=TipBox style="position: absolute; visibility: hidden; background-Color: #ffffee; filter: alpha(Opacity=90); border: 1px solid #000000; z-index: 99"></div>');
        setTimeout('window.onResize=setReload', 500);
    }
    --></script>            
    <title>123</title>
    <body onclick="hideTip()">        
     <a onMouseOver="showTip('<table width=50% border=0 cellpadding=0 cellspacing=0> <tr>    <th scope=row><IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 WIDTH=800 HEIGHT=600 SCROLLING=auto SRC=`http://www.google.com`></IFRAME></th>  </tr></table>')" href="http://www.google.com"><font color="">点这里查看效果</font></a>
    </body>
    pophtm.js 代码如下:
    <!--
    var bV = parseInt(navigator.appVersion);
    var NN4 = document.layers ? true : false;
    var IE4 = document.all && bV >= 4 ? true : false;
    var downloadID = 0;
    var downloadHash = '';
    var showClickprogress = 100;
    var NowDown=0;function showTip(msg)
    {
        var obj = 'TipBox';
        if (showClickprogress < 100) return;    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
        if (NN4)
        {
            if (document.layers[obj].visibility != 'visible')
            {
                with (document[obj].document)
                {
                    open();
                    write('<layer id=TipBox bgColor=#ffffee style="width: 600px; border: 1px solid #000000" onMouseover="keepTip()" onMousewheel="keepTip()" onMouseout="hideTip()">' + msg + '</layer>');
                    close();
                }
                var objp = document.layers.TipBox;
                objp.moveTo(100, e.y + 6);
            }
            document.layers[obj].visibility = 'visible';
        }
        else if(IE4)
        {
            if (document.all[obj].style.visibility != 'visible')
            {
                document.all[obj].innerHTML = msg;
                var x = event.x;
                var y = event.y;
                var objp = document.all.TipBox.style;
                //var yy = document.body.scrollTop + y + 6;
                objp.pixelLeft = x;
                objp.pixelTop =document.body.scrollTop +  y-10;
            }
            document.all[obj].style.visibility = 'visible';
        }
    }
    function keepTip()
    {
        var obj = 'TipBox';
        if (showClickprogress < 100) return;    if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
        if (NN4)
            document.layers[obj].visibility = 'visible';
        else if(IE4)
            document.all[obj].style.visibility = 'visible';
    }
    function hideTip(){
      var obj = 'TipBox';  moveFlag=false;
      if(NN4){
        if(document.layers[obj] != null) document.layers[obj].visibility = 'hidden';
      }else if(IE4)
        document.all[obj].style.visibility = 'hidden';
    }function setReload()
    {
        window.location.reload();
    }
    function showDetail(info_hash)
    {
        var url = info_hash == '' ? 'viewgraph.php' : 'detail.php?info_hash=' + info_hash;
        window.open(url, 'detailview', 'scrollbars=yes, width=500, height=300');
    }
    function GetTorrent()
    {
        torrentdir = Math.floor(downloadID / 2000);
        document.location.href = downloadHash
        NowDown=0;
    }
    function displayClickAD()
    {
        showClickprogress = 0;
        ClickADref = document.all.ClickAD;    var scroll_top = document.body.scrollTop;
        var docwidth = document.body.clientWidth;
        var docheight = document.body.clientHeight;
        var ClickADwidth = ClickADref.offsetWidth;
        var ClickADheight = ClickADref.offsetHeight;
        ClickADref.style.left = docwidth / 2 - ClickADwidth / 2;
        ClickADref.style.top = scroll_top + docheight / 2 - ClickADheight / 2;    ClickADscroll = setInterval('staticClickADbox()', 50);
        ProgressBar = setInterval('controlledhideClickAD()', 400);
        ClickADref.style.visibility = "visible";
    }
    function staticClickADbox()
    {
        var scroll_top = document.body.scrollTop;
        var docheight = document.body.clientHeight;
        var ClickADheight = ClickADref.offsetHeight;
        ClickADref.style.top = scroll_top + docheight / 2 - ClickADheight / 2;
    }
    function hideClickADbox()
    {
        ClickADref.style.visibility = 'hidden';
        if (typeof(ClickADscroll) != 'undefined') clearInterval(ClickADscroll);
        if (typeof(ProgressBar) != 'undefined') clearInterval(ProgressBar);
        document.all.Progress.innerHTML = '<table align=left><tr><td height=5></td></tr></table>';
        GetTorrent();
    }
    function controlledhideClickAD()
    {
        showClickprogress += 50;
        document.all.Progress.innerHTML = '<table width=' + showClickprogress + ' align=left bgColor=green><tr><td height=5><div align=center>正在下载中…</div></td></tr></table>';
        if (showClickprogress > 400) hideClickADbox();
    }
    function DownLoad(id, hash)
    {
    if (NowDown==0){
        NowDown=1;
        downloadID = id;
        downloadHash = hash;
        hideTip();
        IE4 ? displayClickAD() : GetTorrent();
        }
    }-->
      

  15.   

    用jQ的插件boxover吧,挺不错的不光链接,图片或其他的元素也能达到你说的要求Demo:http://boxover.swazz.org/example.html