剑明's profile★☆★我很好★☆★PhotosBlogListsMore Tools Help

Blog


    December 18

    插入背景音乐和视频

    通过这两个脚本可以方便不熟悉html的朋友地插入背景音乐和视频。
    背景音乐和视频支持设置播放次数的设置。
    由于背景音乐没有占位符,无法选中,因此删除背景音乐只能通过html编辑模式删除相应的代码来实现。
     
    使用方法如下:
    1 插入背景音乐
    javascript:document.all("rtebox").getElementsByTagName("div")[2].focus();var s=document.selection.createRange();var d=window.prompt("请输入音频文件地址:","http://");if (d!=null) {var l=window.prompt("请输入播放次数[-1表示一直播放]:","-1"); if (l!=null) {void(s.pasteHTML("<IMG dynsrc=\""+d+"\" loop="+l+" width=0 height=0>"));alert("增加背景音乐成功,请预览效果!");}}
    2 插入视频
    javascript:document.all("rtebox").getElementsByTagName("div")[2].focus();var s=document.selection.createRange();var f="http://";var n="-1";var u=1;try {void(f=s.item(0).dynsrc);void(n=s.item(0).loop);}catch(e){void(u=0);}var d=window.prompt("请输入视频文件地址:",f);if (d!=null) {var l=window.prompt("请输入播放次数[-1或者infinite表示一直播放]:",n); if (l!=null) {if (u==0) void(s.pasteHTML("<IMG dynsrc=\""+d+"\" loop="+l+">")); else {void(s.item(0).dynsrc=d);void(s.item(0).loop=l);}}}
    【方法一】
    进入日志编辑的设计状态下(非HTML状态),将上面的脚本代码复制到地址栏,回车即可。选择视频运行该脚本为修改视频设置。
    【方法二】
    将该脚本一次性地收藏到收藏夹,以后只要进入日志编辑的设计状态下(非HTML状态),单击收藏夹该链接即可。选择视频运行该脚本为修改视频设置。
    加入到收藏夹的方法:
    1 打开IE,不考虑是什么页面,将当前页面加入到收藏夹,名称自己任意起,比如"InsertAudio","InsertVideo"。
    2 复制上面的脚本代码。
    3 在收藏夹中刚才收藏的那个链接上单击鼠标右键,选择"属性",弹出新窗口,将脚本粘贴到"URL"后面的文本框中,单击"确定"按钮,会出现询问你"是否保留这一目标"的对话框,选择"是"即可。
     
     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://weifengming.spaces.live.com/blog/cns!7BFC2CF6DB351D99!520.trak
    Weblogs that reference this entry
    • None