今天有个客户要投放广告,给的素材是flash的,虽然我们不太喜欢,但没办法,客户就喜欢flash,怕一些浏览器或软件屏蔽flash自带的链接,需要我么通过html加一个链接,要不被阻止了效果不好。后果你懂的。
% }! A. @# H9 Y! L$ C( ?# C2 T几年前帮别人维护的时候做过,后来好久不做了,感觉太生疏了,这里特别整理下,方便需要的朋友,希望大家多多支持脚本之家。
) n1 c" S( @" k下面是完整的代码,因为flash文件都比较大我们特别用iframe加载了广告:
# w: k# s$ ~- j: ?% U( D2 e( f' Exml/html code复制内容到剪贴板
( T: |+ S% P& R+ L* c; e<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en > ( @/ @& F: s- I: \4 t% @
<html xmlns=>
- ], I# N$ i9 V4 t1 o! c: \<head>
6 q2 W% f8 {0 P3 s; O: D2 s+ l% {: \<meta http-equiv=content-type content=text/html; charset=gb2312 />
: n. e3 S* @9 G* J! F: M<title>flash加链接_脚本之家专用</title>
0 @4 }* k0 c* `$ |1 q<style type=text/css> 2 ]: q* b+ m( E7 F; v
<!--
, K' f$ q" P. ?# r9 g; pbody {
8 w7 b# P. T/ [5 t* Pposition:relative;
) i7 `; V7 V( l7 Q l/ O/ z2 Mz-index:0;
' T0 c k$ m% R1 V( j+ Qmargin:0; padding:0 . b7 _# I2 n+ E3 G! D3 Z4 t
}
5 U/ {) K9 V {5 v w5 ^7 J: g- abody,td,th {
$ I% M; ]7 G" ], k ]color: #333333;
# u# U5 b D6 M$ V. Q9 e$ |, o+ }} 3 }$ s( f8 [8 ^$ _8 m) l) E, P
*{margin:0; padding:0} 2 z9 A* |/ a$ x) z, F! c* F' G
img{ border:0}
2 ^) t( a6 B- d#jb51{ position:relative; width:300px; height:250px}
- W7 N/ [/ `: m* B7 R#div1 { ( `. R5 y9 V4 h& w( A! S9 g7 j7 q
position:absolute; # C" r$ `( F2 ]9 E7 u& [
left:0;
3 L* j, H, x M9 ]top:0; 1 e p5 a* E& P! N1 c1 B3 B) H" G
width:300px;
: y# G. v" l9 eheight:250px; z-index:-1
) F6 {) e$ @( D( Q0 |9 R
/ K3 C5 o/ w8 X+ v8 l} # a. B) }, }$ ^! u# a i8 G
#div2 {
% R2 s; j7 i& t. o; fposition:absolute; 3 w! y' J) y. A
left:0;
3 Q( b; y& J0 ]- }" K9 `top:0; 5 g1 Z$ n o; T6 `: u% w
width:300px;
; o* K& Z: i+ x6 L. m3 {9 dheight:250px;
. q; m% F5 H3 X6 Az-index:99999;
6 K' q. O' S4 `}
( A4 J( ]9 j0 a# x#div2 a:link{ display:block; width:300px; height:250px}
0 c8 F( \9 `9 g7 V0 N- _" q-->
" L+ G' T. H* ^# v</style></head>
1 n. h3 u; ^6 Q9 B9 i<body> - N( y( e3 ^( y% \
<div id=jb51>
6 L, X; I. N9 m4 t<div id=div1> " S2 `+ v: i$ {6 W3 x
<script type=text/javascript>
1 x+ o; F! G& Y( Q% f% y$ F. w/ bdocument.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase= width=300 height=250>');
+ b; c m( ^5 `5 m( Kdocument.write('<param name=movie value= />'); 4 d! j% t. n! K2 |$ K4 E) ]5 A
document.write('<param name=quality value=high /><param name=wmode value=opaque />'); 3 L+ ~8 |2 @; U$ L# ?
document.write('<embed src= quality=high pluginspage= type=application/x-shockwave-flash width=300 height=250 wmode=opaque></embed>'); % @1 l% u$ C& p" c* B
document.write('</object>');
$ J+ ` l, W- }8 m F</script> 9 i' B6 ^( a0 [& a
</div>
+ y$ c/ ~! K8 h; ?; c<div id=div2>
) C; v; B/ C; O- L, K<a href= target=_blank><img src= width=300 height=250 /></a> 3 o F5 v- ]5 `0 k/ G- U& }
</div> + y# ]. c& F! c- ]& f$ K3 j* C
</div>
1 t6 T) n* {2 J3 f* w</body>
6 c8 d3 R, Y; Y6 [6 P2 j. i9 i' e</html>
3 ]/ _) h, A/ M现在广告管家都不好用了,百度管家停止其它物料,cnzz的被360屏蔽了,google的访问又慢。想进个后台也不容易。没办法只能放自己的服务器里了。' R: t0 S6 ^. z0 D: w: X
需要几点说明的:; t# B1 r8 q, g" Q
<img src= width=300 height=250 />这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。
- g! r4 }3 w! k2 t) P9 ]/ ^8 E- F当然css样式是最重要的,先是position:relative,然后里面的才是position:absolute;# ~& C5 U4 |9 S; v- {+ [
后来从网上看到别人提供的一个方法,通过button按钮实现的,就是不能新窗口打开。也顺便提供下吧。如果大家发现我们的这个也不好用希望能联系我们更新谢谢。( h6 a+ y h' m' }
xml/html code复制内容到剪贴板% l0 t4 h# M5 X8 { m
<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en > : V; ]& v- {1 ?( F* ^
<html xmlns=> " X: b, v7 f& d+ @6 ~
<head>
" f1 o) ]1 j1 v1 u z5 O, Z<meta http-equiv=content-type content=text/html; charset=utf-8 /> 1 }$ N6 n7 b9 z" j1 v; S6 R$ t9 |
<title>无标题文档</title>
6 A9 J" v) X# ^/ M# G% c# ^0 E$ O& z<style type=text/css>
3 W0 u! J' {, b" d M5 p# ]9 ?) j<!--
. }% r& L# }/ h& Z. V0 j$ s1 obody { O3 Z* p5 d4 {7 H4 b
position:relative; % g' X4 m6 x. b1 v# j) S/ n6 j
z-index:0;
% h8 x q# C" O# N* A5 b, f1 S' smargin:0; padding:0 0 D9 F/ ~* N6 j1 F1 c6 Z9 r
} 8 f$ G& Y$ B. p- Z. B' I6 A
body,td,th { / s1 P- R; _" x$ K
color: #333333;
1 D O$ z+ A4 Z}
T# s4 u7 Q. j8 A1 b& o*{margin:0; padding:0} 8 A/ k& N$ N. A& d
img{ border:0} : I W7 ?6 {$ k& M0 A' s
#jb51{ position:relative; width:300px; height:250px} 9 e( D4 G m `
#div1 {
6 L+ s4 a1 }& ]8 oposition:absolute;
9 G) H! s- r, e W5 Ileft:0; . n7 n4 e+ J5 G* M. Z2 S
top:0; 9 u' I+ X3 A, y2 h) @0 c/ w5 T
width:300px; / ~& O1 E( ^/ \9 ^
height:250px; z-index:-1 ( O% M- I# H% }& n- t
9 |' ?8 U: E2 o: ]5 d% N
} . |8 A) p3 P5 C: W8 Y, J7 ~
#div2 { / q* D, R: R5 _! b& E# j4 v3 g- M
position:absolute; 1 C4 u+ Z+ M, @/ o& M$ q
left:0; ) a2 D \! M+ R ~! L& r
top:0; 8 U4 x# S9 i& u* o: ?; C C
width:300px;
; r9 s3 R# P5 A) }. |+ _" r3 Zheight:250px;
" @4 g8 i1 k9 ~z-index:99999; 9 e' a; k$ z* _( `0 B( w: _
} 0 H+ V! Z) G6 E% ]8 j5 M M
--> ' C2 w. \1 q9 P6 {. ~6 U0 }( y; ^4 r+ J
</style>
@8 r: O* h6 u5 p0 I, }</head>
' o2 G- T6 @, V7 `9 ~8 k2 X<body> i% N) ^1 [6 Q0 ~6 j
<button style=width:300;height:250;background:transparent;border:o;padding:0;cursor:hand onclick=window.location.href='http://s.jb51.net'>
9 |8 y% `9 F5 z" V/ A<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 ' _# \* L3 X& x& \* v
codebase= width=100% height=100%>
% V$ z! Z6 T, s0 x8 {$ z: m, e2 J<param name=movie value=>
% \; Z% u n: W1 s) l<param name=quality value=high> , e0 U% K* M7 I' V* D+ M
<param name=wmode value=opaque /> 3 t+ j( U1 I4 M. n6 v0 V
<embed src= width=300 height=250 quality=high pluginspage= type=application/x-shockwave-flash align=middle wmode=opaque> " a6 H, \) L; U5 x
</embed>
8 M5 N. z& s5 ^. G</object> * E1 { J2 {: O5 f4 J' ~ s4 a
</button>
) v2 H# U4 ]! @: @</body>
/ n3 R0 v% E& L$ F3 n</html> 2 C: `0 r5 [# {/ P6 m
% Z: n. z; }# Q更多网页制作信息请查看: 网页制作 |
|