1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 兼容多浏览器实现半透明(Opera ie firefox)

兼容多浏览器实现半透明(Opera ie firefox)

时间:2021-07-29 00:26:41

相关推荐

兼容多浏览器实现半透明(Opera ie firefox)

web前端|css教程

兼容多浏览器实现半透明(Opera,ie,firefox)

web前端-css教程

Click on a link above to make the image disappear and re-appear by gradually fading in/out. It uses CSS transparency, in CSS you can set the transparency in different ways. To ensure that it works on most browsers we use all three.

php源码 打包app,vscode字符宽度,ubuntu tex,tomcat 总是重启,sqlite设置存储路径,图片选项卡插件,mvp框架属于前端还是后端,老房地漏有爬虫,php 字符出现的次数,无锡seo外包策划,幼儿园管理微网站模板下载,手机端加载静态网页,微信公众号小游戏模板lzw

opacity: 0.5;

This one is the official CSS3 method, at the moment it works in newer Mozilla versions.

-moz-opacity: 0.5;

This one works in older versions of Mozilla and Phoenix/FireBird/FireFox.

-khtml-opacity: 0.5;

This is used by browsers that use teh KHTML rendering engine, namely Konquerer on Linux and Safari on MacOS.

filter: alpha(opacity=50);

This one works only in MSIE.

There is actually another one: -khtml-opacity: 0.5; works for the browsers Konquerer on Linux and Safari on MacOS. You could add it too if you want to support these users. Somewhere in the near future most browsers will support CSS3 and opacity: 0.5; should work everywhere.

android 团购 源码,mac16 m1 vscode,ubuntu日语输入法,tomcat如何看成功发布,sqlite 建主键,广州网页设计信息,租用联通服务器吗,横向菜单js插件,js前端框架 app,遵义养爬虫的,php获取昨天的日期,官网seo优化,springboot第六节课,jsp 开源网站,网页代码

,nopcommerce 模板制作,ecshop 页面分页显示,什么是简易管理系统,弹幕网站程序lzw

function opacity(id, opacStart, opacEnd, millisec) {

//speed for each frame

var speed = Math.round(millisec / 100);

var timer = 0;

114结嫁网源码在哪,使用vscode配置go,求字体 ubuntu,tomcat 保存乱码,安卓sqlite软件下载,jquery数据分页插件,前端框架年年不一样,怎么运用爬虫写论文题目,如何查看php的版本,华阴seo优化排名,摄影网站cms,wap静态网页,ecshop专题页面模板lzw

//determine the direction for the blending, if start and end are the same nothing happens

if(opacStart > opacEnd) {

for(i = opacStart; i >= opacEnd; i--) {

setTimeout("changeOpac(" + i + ",\" + id + ")",(timer * speed));

timer++;

}

} else if(opacStart < opacEnd) {

for(i = opacStart; i <= opacEnd; i++)

{

setTimeout("changeOpac(" + i + ",\" + id + ")",(timer * speed));

timer++;

}

}

}

//change the opacity for different browsers

function changeOpac(opacity, id) {

var object = document.getElementById(id).style;

object.opacity = (opacity / 100);

object.MozOpacity = (opacity / 100);

object.KhtmlOpacity = (opacity / 100);

object.filter = "alpha(opacity=" + opacity + ")";

}

function shiftOpacity(id, millisec) {

//if an element is invisible, make it visible, else make it ivisible

if(document.getElementById(id).style.opacity == 0) {

opacity(id, 0, 100, millisec);

} else {

opacity(id, 100, 0, millisec);

}

}

function blendimage(divid, imageid, imagefile, millisec) {

var speed = Math.round(millisec / 100);

var timer = 0;

//set the current image as background

document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";

//make image transparent

changeOpac(0, imageid);

//make new image

document.getElementById(imageid).src = imagefile;

//fade in image

for(i = 0; i <= 100; i++) {

setTimeout("changeOpac(" + i + ",\" + imageid + ")",(timer * speed));

timer++;

}

}

function currentOpac(id, opacEnd, millisec) {

//standard opacity is 100

var currentOpac = 100;

//if the element has an opacity set, get it

if(document.getElementById(id).style.opacity < 100) {

currentOpac = document.getElementById(id).style.opacity * 100;

}

//call for the function that changes the opacity

opacity(id, currentOpac, opacEnd, millisec)

}

更多参考

/scripts_js_blendtrans.php

/blog//03/21/ie-firefox-opera-alpha-transparency/

/stories/pngopacity/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。