純JS半透明Tip效果

2021-04-21 04:56:25 字數 2731 閱讀 3162

自己根據網上提供的乙個透明功能類庫寫的純js半透明tip效果

//複製乙個背景

var bg = target.clonenode(true);

if (bg) 

bg.style.filter = "alpha(opacity=0)";

bg.style.opacity = 0;

opacity("bg1", 0, 90, 300);

bg.style.display="block";

}target.style.display = "block";

}function hiddencontent(i, event) else 

hiddenid = "content" + i;

document.getelementbyid(hiddenid).style.display = "none";

var bg = document.getelementbyid("bg1");

if (bg) 

}script

>

<

style

type="text/css"

>

pstyle

>

head

>

<

body

>

<

ahref="#"

onmouseover="showcontent(0, event)"

onmouseout="hiddencontent(0, event)"

style="cursor:default"

>鏈結

a>

<

divid="content0"

style="width:200px;height:300px;padding:2em;display:none"

> 這是文章標題1,文字是不透明的

div>

<

span

onmouseover="showcontent(1, event)"

onmouseout="hiddencontent(1, event)"

style="cursor:default"

>有提示文字

span

>

<

divid="content1"

style="width:200px;height:300px;padding:2em;display:none;font-weight:700"

> 這是文章標題2,文字是不透明的

div>

<

divstyle="width:34%;color:#226"

>

<

p>教育是開啟完全不同未來大門的重要鑰匙。在美國十大城市中,要求 

中學以下文化程度的職位數從 1970 年起已經減少了一半。從 1989 年起, 

美國新設職位的 2/3 都是專業人員和管理人員(38)。在德國,到 2010 年 

將只有 10%的職位適合非技術工人,而在 1976 年為 35%。(39) 

p>

<

p>但這並不只是乙個失業問題。失業的年輕人傾向於從事更多的暴力犯 

罪,並不願擔當家長的責任。「青春期男孩是最反覆無常並最具暴力的了。 

美國一半的暴力犯罪是由 24 歲以下的男孩幹的,四分之一的暴力犯罪事 

件是由 18 歲以下男孩幹的。大多數西方國家的資料也與美國相似。」

p>

div>

body

>

html

>

QT 透明 半透明 效果

objwindow setwindowopacity 只對視窗有效,setattribute qt wa translucentbackground,true 對於視窗widget必須設定為qt framelesswindowhint include qgraphicsopacityeffect o...

LinearLayout半透明效果

透明效果有很多中實現方式,可以 實現,也可以直接在布局檔案中實現。簡單點的就是直接給控制項設透明背景 android background 88323232 上面是常見的灰色半透明效果,當你設定了乙個錯誤的color值時會得到以下提示資訊 error color value not valid mu...

背景半透明效果

背景為紅色 ff0000 透明度20 css example source code alpha1 ap2 這樣基本就可以實現啦,也不用擔心定位和自適應問題,最大的問題是僅ie支援。如果相容ff op怎麼寫呢?首先,上面這種定法是不行的啦,那就只能用兩個層重疊的方法啦。改下頁面結構與css樣式 ht...