今天有个客户要投放广告,给的素材是flash的,虽然我们不太喜欢,但没办法,客户就喜欢flash,怕一些浏览器或软件屏蔽flash自带的链接,需要我么通过html加一个链接,要不被阻止了效果不好。后果你懂的。
S3 V. F% o2 `" o几年前帮别人维护的时候做过,后来好久不做了,感觉太生疏了,这里特别整理下,方便需要的朋友,希望大家多多支持脚本之家。* H* ~4 d% G8 C- [
下面是完整的代码,因为flash文件都比较大我们特别用iframe加载了广告:7 H9 @' b; y! Y
xml/html code复制内容到剪贴板" Q9 ?* _9 n& @ O: |* p
<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en > 2 G: m9 I+ a! A+ W2 X8 |6 M
<html xmlns=> & t/ Z+ G% I, _* y' z
<head>
5 \5 @& ~5 a3 e2 ?1 h9 ~<meta http-equiv=content-type content=text/html; charset=gb2312 /> ) Y* s& f0 S8 {4 b4 `; b7 M
<title>flash加链接_脚本之家专用</title>
+ Q/ D* e8 T3 m<style type=text/css> 4 j! ]% a4 x$ F2 s: a/ l! S) i
<!--
! }% x x( n1 `4 R Q, q- vbody { : B& `6 X! T$ _& n" O) N; T
position:relative; 6 F: G+ N' M( G8 p) S, ~5 t# w0 I
z-index:0;
7 S5 B* R Y3 M9 B* J% ?. x" Pmargin:0; padding:0 2 H& g4 J# t/ ?; d
} ! d: g0 A% Z, m+ P# D6 u7 N3 N
body,td,th {
$ r2 n5 F* H2 dcolor: #333333;
# E; k2 S8 `/ m" ^} 1 B8 o( }; j# L( P
*{margin:0; padding:0} ) L2 Z$ l: @6 F3 M6 |. `
img{ border:0}
9 {& b) r: n, g9 R/ G#jb51{ position:relative; width:300px; height:250px} - I3 g* E5 v1 F6 a
#div1 {
m: K( ^* Q/ G' M0 Rposition:absolute; & j( j+ }$ c8 M8 z
left:0;
9 i U2 d7 n4 j8 S2 b& w& i' Atop:0;
K0 D& A) j2 i# u& W7 S3 n/ @width:300px;
: s9 r' l k2 Y5 G1 @height:250px; z-index:-1 : B/ p) Q0 b; h+ f
9 @- [+ n7 \( k( E}
* O( j! n4 n/ W, F: V+ i#div2 {
8 N( p; c( b! p; Z w- Cposition:absolute; # s- R; s! L9 c
left:0;
, y; b- b5 h) c7 l8 B/ t6 Ntop:0;
0 ^+ P1 T4 T- x4 o- U* v: `width:300px;
; K0 q1 I) ~& I& {) sheight:250px;
4 J+ c5 L7 r. Xz-index:99999;
* [+ S! j0 T6 K} 2 w3 q& U5 X- @9 s, F$ c& M
#div2 a:link{ display:block; width:300px; height:250px}
3 w- Y0 S) @0 ^-->
& f' C% J7 Y; L, ?1 c0 q6 q5 k</style></head>
9 w) r( O( _% }4 l" m; I<body>
+ S- }* D4 z! B. Z+ q5 }' M<div id=jb51>
! [+ c# _+ @9 N0 e3 H* b, h+ J<div id=div1>
; Q3 z$ z& d7 S! i$ A. I( ]/ g% A<script type=text/javascript> / ?+ R* H3 F8 ]& z9 S
document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase= width=300 height=250>'); 1 G0 w$ B2 v: p2 g; g
document.write('<param name=movie value= />'); ) W! T1 W5 k1 Y K s4 B
document.write('<param name=quality value=high /><param name=wmode value=opaque />');
) h! t! Z6 Y9 F k) x* Mdocument.write('<embed src= quality=high pluginspage= type=application/x-shockwave-flash width=300 height=250 wmode=opaque></embed>');
' q' E$ d! e+ S. ^+ Pdocument.write('</object>');
/ g/ H- W: A2 ?/ E; B</script>
! B7 u: D& s8 y# c: S- }</div> & J: j) s6 C( V2 r l$ Y
<div id=div2> % P5 O) ?6 c7 [+ P; v# d% [( \
<a href= target=_blank><img src= width=300 height=250 /></a> # d& e" F, M) F0 p4 ?
</div>
1 L Y J( j+ L) i) P1 S7 o</div> # t* U7 j6 B! R0 G3 m
</body> - ]6 n+ _4 z* Q5 L# J8 [: O
</html>
+ e2 y# L7 p+ @: l/ U% I, V# Y现在广告管家都不好用了,百度管家停止其它物料,cnzz的被360屏蔽了,google的访问又慢。想进个后台也不容易。没办法只能放自己的服务器里了。
5 X8 z% J3 c* b2 Q# \6 K需要几点说明的:
" d0 J8 {% f+ X" Q! F<img src= width=300 height=250 />这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。 X( A3 a+ Z" z" o9 H
当然css样式是最重要的,先是position:relative,然后里面的才是position:absolute;
G$ j( x: q2 ~6 x- i$ U' |后来从网上看到别人提供的一个方法,通过button按钮实现的,就是不能新窗口打开。也顺便提供下吧。如果大家发现我们的这个也不好用希望能联系我们更新谢谢。/ d0 V" p9 f; L! Z
xml/html code复制内容到剪贴板
" B( } }) w5 C/ {; a<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en >
) {* P$ Q! i; k' `& v' [<html xmlns=>
k% x8 j3 R5 t$ M, }, \<head>
$ U9 y2 y0 d2 q4 H1 s- |<meta http-equiv=content-type content=text/html; charset=utf-8 /> 9 V$ \: V( f$ o5 ?7 W+ }) ]- y
<title>无标题文档</title>
+ s+ T5 k& E2 q* ^8 q/ B4 P) T<style type=text/css> # q0 e! ?2 J3 H
<!--
[7 p) N0 R+ b' f8 `7 a4 \0 ]body {
^. ~/ I, R4 I6 J. [position:relative;
; J L. i, g, @ n9 Pz-index:0;
\; J0 B2 V- G! k* r3 a7 X/ m! ~margin:0; padding:0 # `9 M5 g) I' _+ L# |
} 8 A) M' i3 H' l B- h, F
body,td,th { % }: g0 ?/ w) N6 m* e) Z: L
color: #333333; 3 Q6 j7 \7 u$ `/ H' Y" F& e
} ' e* J% r. I& k2 ~, Y! f- K- `
*{margin:0; padding:0}
' B+ `' R- f$ g# G- e& g, ~4 h, h3 zimg{ border:0}
7 v2 A1 ]* y. Y#jb51{ position:relative; width:300px; height:250px} 9 G* @0 a/ a* o0 |! t7 r' E% K
#div1 { s, H/ g7 l: M+ ~8 U
position:absolute;
4 F. h% ?9 V7 ~8 X+ i4 l2 oleft:0; : Q! G0 M) B2 B( B
top:0;
5 b7 _" d& d; O- v& @width:300px; 5 w& \: a3 _- F& V
height:250px; z-index:-1 2 Z5 ?2 H- B1 C/ o/ E$ Y6 Z4 A
X. p$ T X, V+ w7 y9 P
} 9 h; r5 I; R+ a) V
#div2 { 8 W. C: Y. }9 N* y5 z
position:absolute; # J9 {) f0 l4 C( H4 x% V9 t
left:0;
0 k4 Q7 m6 K: C4 ]- ~, etop:0; % _5 B; Q0 D/ a& h& b* T
width:300px; 3 ^2 p R/ p' H- m0 q9 I
height:250px; + h/ D' }9 J/ ?8 s) t
z-index:99999; 5 P' h5 V/ s8 N
} . B9 c, z3 `0 f1 N* x5 H7 C
-->
7 m1 ]; F. p8 k9 q2 ~4 a</style>
! Z; X/ f9 d4 i! e+ @</head>
- w. L. d' ~2 [3 I<body> 8 n) u+ w& s; E' F. J, r
<button style=width:300;height:250;background:transparent;border:o;padding:0;cursor:hand onclick=window.location.href='http://s.jb51.net'>
' F/ Z( L& ]8 \$ ?<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 4 U$ Y6 \' Y, [5 Y
codebase= width=100% height=100%> & I! f! a+ a3 A- a& a9 \
<param name=movie value=>
8 `7 I; S/ B$ L+ p3 c2 ~9 l<param name=quality value=high> ( s! i9 k; X) g
<param name=wmode value=opaque />
( C5 j/ |2 o6 k+ K( m. x<embed src= width=300 height=250 quality=high pluginspage= type=application/x-shockwave-flash align=middle wmode=opaque>
+ F% c* s2 g9 h9 M( W, Y- _* D* B v; e</embed>
) E9 j+ D5 I2 P; F! I/ J2 q$ p</object>
; x+ q, z9 l3 o' D* ~ ]' {: P5 r</button>
/ O) Z# O1 Q) m* p' y2 ]</body> ' E0 `5 C* \# C. p& F* d
</html>
% g( d: a- M* F7 X+ K4 ^
9 Y y9 u% l/ [( T更多网页制作信息请查看: 网页制作 |
|