社区
JavaScript
帖子详情
title属性实现换行,在firefox中不行,好像得写一个js的title类怎么做啊??
ppsdog198497
2007-07-04 01:40:50
<a href=# title="第一行 第二行 第三行">title分行测试</a>
在IE 6中可以,在firefox中如何实现,有例子吗
...全文
1654
4
打赏
收藏
title属性实现换行,在firefox中不行,好像得写一个js的title类怎么做啊??
title分行测试 在IE 6中可以,在firefox中如何实现,有例子吗
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tao521ye
2011-11-18
打赏
举报
回复
不能用
ppsdog198497
2007-07-05
打赏
举报
回复
实现不了
rjzou2006
2007-07-04
打赏
举报
回复
function AutoSizeDIV(objID){
var obj=document.getElementById(objID);
if (obj.scrollHeight < obj.offsetHeight){
obj.style.height = obj.scrollHeight+2;
}
}
//文字提示信息
<!--
var pltsPop=null;
var pltsoffsetX = 10; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适
var pltsoffsetY = 15; // 弹出窗口位于鼠标下方的距离;3-12 合适
var pltsPopbg="#cccccc"; //背景色
var pltsPopfg="#111111"; //前景色
var pltsTitle="";
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
function pltsinits()
{
document.onmouseover = plts;
document.onmousemove = moveToMouseLoc;
}
function plts()
{ var o=event.srcElement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltsPop=o.dypop;
if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
{
pltsTipLayer.style.left=-1000;
pltsTipLayer.style.display='';
var Msg=pltsPop.replace(/\n/g,"<br>");
Msg=Msg.replace(/\0x13/g,"<br>");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(Msg))pltsTitle="<font color=#ffffff>提示</font>";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltsTitle=Msg.replace(re,"$1")+" ";
re=/\{(.[^\{]*)\}/ig;
Msg=Msg.replace(re,"");
Msg=Msg.replace("<br>","");}
var attr=(document.location.toString().toLowerCase().indexOf("list.asp")>0?"nowrap":"");
var content =
'<table style="FILTER:alpha(opacity=90) shadow(color=#bbbbbb,direction=135);" id=toolTipTalbe border=0 width="300px"><tr><td width="100%"><table class=tableBorder7 cellspacing="0" cellpadding="0" style="width:100%">'+
'<tr id=pltsPoptop ><th height=18 valign=bottom class=th1 ><b><p id=topleft align=left><font color=#ffffff>↖</font>'+pltsTitle+'</p><p id=topright align=right style="display:none">'+pltsTitle+'<font color=#ffffff>↗</font></b></th></tr>'+
'<tr><td "+attr+" class=tablebody7 style="padding-left:10px;padding-right:10px;padding-top: 6px;padding-bottom:6px;line-height:135%">'+Msg+'</td></tr>'+
'<tr id=pltsPopbot style="display:none"><th height=18 valign=bottom class=th1><b><p id=botleft align=left><font color=#ffffff>↙</font>'+pltsTitle+'</p><p id=botright align=right style="display:none">'+pltsTitle+'<font color=#ffffff>↘</font></b></th></tr>'+
'</table></td></tr></table>';
pltsTipLayer.innerHTML=content;
toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
moveToMouseLoc();
return true;
}
else
{
pltsTipLayer.innerHTML='';
pltsTipLayer.style.display='none';
return true;
}
}
function moveToMouseLoc()
{
if(pltsTipLayer.innerHTML=='')return true;
var MouseX=event.x;
var MouseY=event.y;
//window.status=event.y;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{
popTopAdjust=-popHeight-pltsoffsetY*1.5;
pltsPoptop.style.display="none";
pltsPopbot.style.display="";
}
else
{
popTopAdjust=0;
pltsPoptop.style.display="";
pltsPopbot.style.display="none";
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";
}
else
{
popLeftAdjust=0;
topleft.style.display="";
botleft.style.display="";
topright.style.display="none";
botright.style.display="none";
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();
//-->
rjzou2006
2007-07-04
打赏
举报
回复
<a href="df" title="sdfas<br>sdfsal<br>sdfsadf">dddd</a>
tooltip.js
//alt,title 样式,配合样式表使用,页面引用此js即可
/********** 文字提示信息样式 **********/
//.tableBorder7
//{width:800;solid; background-color: #fff;}
//TD
//{font-family: 宋体;font-size: 12px;line-height : 15px ;}
//th
//{background-color: #f7f7f7;color: #fff;font-size: 12px;font-weight:bold;}
//th.th1
//{background-color: #444;}
//td.TableBody7 /*内容背景*/
//{background-color: #f8f8f8;}
/***************************************/
/*
var postSubmited = false;
function ctlent(obj) {
if(postSubmited == false && (event.ctrlKey && window.event.keyCode == 13) || (event.altKey && window.event.keyCode == 83)) {
if(this.document.input.topicsubmit) this.document.input.topicsubmit.disabled = true;
if(this.document.input.replysubmit) this.document.input.replysubmit.disabled = true;
if(this.document.input.editsubmit) this.document.input.editsubmit.disabled = true;
postSubmited = true;
this.document.input.submit();
}
}
*/
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width>=518){
ImgD.width=518;
ImgD.height=(image.height*518)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
function displayleft(obj,name)
{
LeftDiv=eval("document.all."+name)
if (LeftDiv.style.display=="")
{
LeftDiv.style.display="none";
}
else
{
LeftDiv.style.display="";
}
}
function displayleft1(obj,name)
{
upDiv=eval("document.all."+name)
if (upDiv.style.display=="")
{
upDiv.style.display="none";
}
else
{
upDiv.style.display="";
}
}
function showIntro(objID)
{
if (document.getElementById(objID).style.display == "none") {
document.getElementById(objID).style.display = "";
}else{
document.getElementById(objID).style.display = "none";
}
}
function winconfirm(confirmMSG,confirmURL){
question = confirm(confirmMSG);
if (question != "0"){
window.location=confirmURL;
}
}
function CopyText(obj) {
ie = (document.all)? true:false
if (ie){
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}
}
function UBBShowObj(strType,strID,strURL,intWidth,intHeight)
{
var varHeader="V";
var tmpstr="";
var bSwitch = false;
bSwitch = document.getElementById(varHeader+strID).value;
bSwitch =~bSwitch;
document.getElementById(varHeader+strID).value = bSwitch;
if(bSwitch){
document.getElementById(strID).innerHTML = "影音文件源地址:<a href='"+strURL+"' target='_blank'>"+strURL+"</a>";
}else{
switch(strType.toUpperCase()){
case "SWF":
tmpstr="<object codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+intWidth+"' height='"+intHeight+"'><param name='movie' value='"+strURL+"'><param name='quality' value='high'><param name='AllowScriptAccess' value='never'><embed src='"+strURL+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+intWidth+"' height='"+intHeight+"'>'"+strURL+"'</embed></OBJECT>";
break;
case "WMA":
tmpstr="<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id='MediaPlayer' width='"+intWidth+"' height='"+intHeight+"'><param name='ShowStatusBar' value='-1'><param name='AutoStart' value='True'><param name='Filename' value='"+strURL+"'></object>";
break;
case "WMV":
tmpstr="<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' width='"+intWidth+"' height='"+intHeight+"'><param name='ShowStatusBar' value='-1'><param name='AutoStart' value='Ture'><param name='Filename' value='"+strURL+"'></object>";
break;
case "RM":
tmpstr="<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' height='"+intHeight+"' id='Player' width='"+intWidth+"' viewastext><param name='_ExtentX' value='12726'><param name='_ExtentY' value='8520'><param name='AUTOSTART' value='0'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='CONTROLS' value='ImageWindow'><param name='CONSOLE' value='_master'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='"+strURL+"'><param name='BACKGROUNDCOLOR' value='#000000'></object><br><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' height='32' id='Player' width='"+intWidth+"' VIEWASTEXT><param name='_ExtentX' value='18256'><param name='_ExtentY' value='794'><param name='AUTOSTART' value='-1'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='CONTROLS' value='controlpanel'><param name='CONSOLE' value='_master'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'><param name='SRC' value='"+strURL+"'></object>";
break;
case "QT":
tmpstr="<embed src='"+strURL+"' autoplay='true' Loop='false' controller='true' playeveryframe='false' cache='false' scale='TOFIT' bgcolor='#000000' kioskmode='false' targetcache='false' pluginspage='http://www.apple.com/quicktime/'>";
break;
case "RA":
tmpstr="<object classid='clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' id='RAOCX' width='"+intWidth+"' height='"+intHeight+"'><param name='_ExtentX' value='6694'><param name='_ExtentY' value='1588'><param name='AUTOSTART' value='0'><param name='SHUFFLE' value='0'><param name='PREFETCH' value='0'><param name='NOLABELS' value='0'><param name='SRC' value='"+strURL+"'><param name='CONTROLS' value='StatusBar,ControlPanel'><param name='LOOP' value='0'><param name='NUMLOOP' value='0'><param name='CENTER' value='0'><param name='MAINTAINASPECT' value='0'><param name='BACKGROUNDCOLOR' value='#000000'><embed src='"+strURL+"' width='253' autostart='true' height='60'></embed></object>"
}
document.getElementById(strID).innerHTML = tmpstr;
}
}
html 可
换行
属性
,html
中
title
属性
换行
实现
本文主要讲解titile
属性
换行
的
实现
方式。 元素可定义文档的标题,可以应用在img、a等标签上。1、
实现
方式:html
中
title
属性
换行
实现
孟繁贵的博客园孟繁贵的博客园2、效果:3、原理在html
中
的回车和
换行
符为:—
换行
Line feed— 回车Carriage Return所以:和 均可
实现
title
属性
换行
。html a 链接标签
title
属性
换行
鼠标悬停提示内容的
换行
效果鼠标经过悬停...
jqgrid使用colModel的classes
属性
实现
单元格内容过长自动截取带省略号和强制
换行
jqgrid单元格默认不
换行
,超出部分被隐藏,鼠标移上去会显示全部内容,原因是单元格设置了overflow:hidden和
title
属性
。我们可以通过colModel的classes
属性
,给列设置class改变jqgrid单元格默认显示样式。比如单元格内容强制
换行
,单元格内容超出部分用省略号显示。
javascript
中
的document的writeln()方法为什么没有
换行
直接po图和代码 https://zhidao.baidu.com/question/148328405.html 我分别用火狐、IE、谷歌这3个浏览器来
做
测试 图1:这是源码 先看看IE浏览器的效果(浏览器版本是IE11) 从上图可以看出,在浏览器
中
显示的时候,write()函数和writeln()函数都没有
换行
. write()函数没有空格的效果,而writeln()函数多...
Firefox
火狐的
一个
奇特的错误
最近
写
一个
关于用JavaScript
做
图片自动切换问题发现
一个
非常奇特的问题,除了空格和
换行
外完全相同的代码,在
Firefox
下却有截然不同的运行结果,今天记录以提供他人留意及自我备查。 废话不多说,先上代码给大家看看 代码1 <!-- {cps..0}--><! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transiti...
firefox
与IE对javascript和CSS的区别(浏览器兼容)
最近在
做
一个
项目,在IE内核浏览器上一切都运行正常,但换成
FireFox
就
不行
,先是页面显示不完全,有好多内容被覆盖了,然后就是好多样式都乱了,为了解决这个问题所以就好好研究了一下浏览器兼容问题。 下面是看的一位大牛
写
的文章,地址为:http://blog.sojump.com/default.aspx?page=12
firefox
与IE对javascript和CSS的区别: keywor
JavaScript
87,992
社区成员
224,688
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章