<IMG src="http://192.168.0.3/jingjib/admin/upfile/20050224093347-0.jpg" id="myimg">
<script language="javascript">
document.all.myimg.align = "left";
</script>
<script language="javascript">
document.all.myimg.align = "left";
</script>
解决方案 »
- 在引入js之后,怎么才能渲染快点
- jquery伸缩层存入cookie问题?
- jQuery选择器后面跟个this是什么意思
- 用smarty从php得到一个值,如果这个值为空则不显示img标签,如果不为空则作为img的src
- 风讯的系统js和自由js
- 遇到这样的问题,没办法了,求救啊
- JS的正则问题,都被搞晕了,不知道问题出在哪里,SOS SOS @_@ @_@ @_@ @_@
- 表格显示.紧密问题,紧密求教..
- 求个function,使该文本框不能输入小于等于0的数
- 关于层的叠加问题,谢谢!
- ★☆★☆巨疑惑的一个难题---怎么在web模式下实现报表多页连续打印功能?
- 利用鼠标点击事件控制表格行的背景问题?
window.opener.frames.message.document.execCommand('InsertImage', false, imagePath);
插入的。这个命令不能进行参数添加!
var obj = null;
for(var i=document.images.length; i>=0; i--)if(document.images[i].src==imagePath)obj=document.images[i];
if(obj)obj.align = "left";
window.opener.frames.message.document.execCommand('justifycenter', , null);
//居左
window.opener.frames.message.document.execCommand('justifyleft', , null);
//居右
window.opener.frames.message.document.execCommand('justifyright', , null);
//两端对齐
window.opener.frames.message.document.execCommand('justifyfull', , null);
楼上的没有看明白我的意思:window.opener.frames.message.document.execCommand('justifyleft', , null);结果是:
<P align=left><IMG src="http://192.168.0.3/jingjib/admin/upfile/20050224093347-0.jpg"></P>GageCSDN(稻草人) sfply(随风飘零叶) 还没有解决我的问题:window.opener.frames.message.document.execCommand('InsertImage', false, imagePath);已经插入到编辑器中了,如果只设定图片的if(obj)obj.align = "left";没有实现功能。
我想在代码中添加:align='left'到现在还没有解决方法.
<html>
<head>
<script>
function insertImage(imagePath){
iEdit.focus();
document.selection.clear;
obj1=iEdit.document.selection.createRange()
obj1.pasteHTML("<img src="+imagePath+" align='left'>");
}
</script>
</head>
<body LANGUAGE=javascript onload="iEdit.document.designMode='on'">
<iframe id=iEdit></iframe>
<input type=button onclick=insertImage("http://community.csdn.net/images/CSDN_logo.GIF")>
</body>
</html>