今天有个客户要投放广告,给的素材是flash的,虽然我们不太喜欢,但没办法,客户就喜欢flash,怕一些浏览器或软件屏蔽flash自带的链接,需要我么通过html加一个链接,要不被阻止了效果不好。后果你懂的。. w, ~4 a6 |- W1 b, ^
几年前帮别人维护的时候做过,后来好久不做了,感觉太生疏了,这里特别整理下,方便需要的朋友,希望大家多多支持脚本之家。
2 a7 [* F4 N) G0 [# X- ^2 K- G( {下面是完整的代码,因为flash文件都比较大我们特别用iframe加载了广告:
8 G; @5 O8 Q7 C5 Ixml/html code复制内容到剪贴板. q& R7 }7 h8 l5 q( H
<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en > O; r9 x9 p: u6 C
<html xmlns=> 2 ^, g4 @) [2 v1 } x( m! f% c7 e* {
<head>
. [; U) _5 i5 g# T1 N: X' o<meta http-equiv=content-type content=text/html; charset=gb2312 /> : I5 p/ ]; ?* f; X1 e
<title>flash加链接_脚本之家专用</title> ! @0 u# _$ h, T' I- w+ o. @
<style type=text/css>
* g5 W& B" f0 V, J4 I<!-- 2 l; ^. R" F( Y; l9 i* a) r; m
body { 9 l( ~% S# k2 L; ~: |% \' ?$ i: j9 N4 R
position:relative;
3 P% R' o/ ?0 h2 t! t0 ^ az-index:0; " F! T: g3 ]9 P& |& j$ `0 u) g
margin:0; padding:0 8 r* k8 P5 _% y1 o3 K% P( R- \* g
} 3 @3 b# @- A. h+ q- f0 U
body,td,th {
7 Q% }$ Z( f0 Wcolor: #333333; 9 p. y0 Z7 k4 `; q! d+ J7 E& @& J* o& `
}
, l' s9 y5 }0 P! S+ p0 K+ K*{margin:0; padding:0}
3 @; x) M# H; Z9 m7 g Dimg{ border:0} % t$ J6 T: T6 O, T: I) {7 P; X7 j& x0 r
#jb51{ position:relative; width:300px; height:250px} 0 J4 Q) e1 D3 J/ B" a5 `/ o" s
#div1 {
3 p: ^# S' n3 P& G- E ~ }1 jposition:absolute;
; n* M, K+ s# s U8 {. Qleft:0;
+ S% ]8 V* |* g) {4 Q# K _+ [ _top:0;
/ p5 C* Q ^! H/ `width:300px;
1 I* o% W# J: P6 Pheight:250px; z-index:-1
* L- v+ ^' o. T5 ]1 P5 @ \: W0 s+ Y7 G6 S
}
7 A p9 ?3 H8 o- m1 ~#div2 {
8 w- F& O" m5 } mposition:absolute; & Q3 \! r& K7 q6 |; V& B
left:0;
2 F( c9 Z2 u% X$ I$ otop:0; * ?2 u l1 G6 d/ m. s, }, Y7 r
width:300px; 2 W0 a9 z! \$ V' \# v
height:250px;
4 c, p% z% S( u/ T# m) C+ Pz-index:99999;
5 X @5 _5 l5 b, C& Q$ M}
- r9 W1 Z+ A- ^, P# _#div2 a:link{ display:block; width:300px; height:250px} # P: d6 {1 l9 k+ Z6 U9 a
--> # L+ \1 ~. C! {* T2 p* g
</style></head> 5 L l% A# U- F C; T8 v1 N
<body>
& r2 W9 g6 E) [( q4 `! c4 s7 g/ I* N/ I<div id=jb51>
3 Q( H! h& O7 q6 L* v5 Q" q<div id=div1> ; e* m* h5 M6 `1 h
<script type=text/javascript>
& i! _5 B( t- T* a4 j. M) Cdocument.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase= width=300 height=250>'); / X' o* E+ ]3 N6 f3 a @" }% y
document.write('<param name=movie value= />'); 0 W) X" P) w" l9 V" D
document.write('<param name=quality value=high /><param name=wmode value=opaque />');
$ U Z4 ~2 p* y2 S3 X, T- ydocument.write('<embed src= quality=high pluginspage= type=application/x-shockwave-flash width=300 height=250 wmode=opaque></embed>');
0 B3 j1 V x9 ~+ F% g- Mdocument.write('</object>'); 9 p/ B* A, ^+ L% G
</script>
+ b- S! S' \" {8 K: J</div>
* k- Z4 e6 [- H* M<div id=div2> % o2 C& |" Z6 _* i6 |# q- Z
<a href= target=_blank><img src= width=300 height=250 /></a>
1 | i( E( s7 n0 D</div> - J! z n0 l H8 O! ^, ~
</div>
5 K X" w8 E: X8 e. n7 z1 M</body>
$ o; K% [* H1 b% u8 p5 D</html>
7 n. E3 x5 N5 U8 T现在广告管家都不好用了,百度管家停止其它物料,cnzz的被360屏蔽了,google的访问又慢。想进个后台也不容易。没办法只能放自己的服务器里了。, ]' |; B d8 |
需要几点说明的:. |/ K( s8 @8 `! v+ x
<img src= width=300 height=250 />这个里面的touming.png就是个1像素的透明png文件。不要图片的话ie下链接不对。
! G. b6 F; O' J* s) u当然css样式是最重要的,先是position:relative,然后里面的才是position:absolute;* T8 Z# S- N8 n2 p+ o |) z h
后来从网上看到别人提供的一个方法,通过button按钮实现的,就是不能新窗口打开。也顺便提供下吧。如果大家发现我们的这个也不好用希望能联系我们更新谢谢。0 G! L- E4 v6 R
xml/html code复制内容到剪贴板' U5 r, y: _$ L% s0 \
<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en > & L b2 K* N0 e. r* Q1 G
<html xmlns=> - W+ O p; z$ c7 b6 I( }2 V/ U; z
<head>
* \$ \8 k( i( R/ }7 z<meta http-equiv=content-type content=text/html; charset=utf-8 /> - G+ u ]; p1 H) V; ]. u8 h$ A
<title>无标题文档</title>
9 N; T) m9 W3 M9 i/ R$ a<style type=text/css> & L& @. k3 i! a5 \( N; y. b
<!--
5 a+ k; V( ~ y. R. f6 Y* ^/ sbody { ; L( O4 [3 F) M
position:relative; 2 ^) z+ h$ D3 b- D, I/ }
z-index:0; & d! Y' v) s; G# J7 y; S
margin:0; padding:0
8 G# R2 s9 \ L1 V) Q- h- d} 7 k' o. U1 h2 k* u9 x5 ], r
body,td,th { 4 i' d+ l; i3 n. T3 _3 v
color: #333333;
- j. }9 l' j6 T# M8 Z} & [& R: S! G* n6 {
*{margin:0; padding:0} 6 c# V, A6 O! k+ @3 ^3 A
img{ border:0} , d/ P) I8 Z4 ~! U
#jb51{ position:relative; width:300px; height:250px}
: H! c D; ~4 I, T7 c2 c2 ^#div1 { & a6 ^1 C! e9 v& D7 a
position:absolute;
" M: c0 @; L" F6 p( mleft:0;
2 n7 ]. L. I1 d @& s% B2 Dtop:0;
9 s5 A- \+ T9 w5 p, Kwidth:300px; " O5 d0 X" o7 I. c" M
height:250px; z-index:-1 $ e* i3 j0 e6 T0 u
2 J* C# C, |% B( b3 g5 B' J
} / |# D1 M# e0 b
#div2 { # c! m7 x% }; {3 G) ?/ m
position:absolute;
6 ^; j: F- Y; M! y8 `: mleft:0;
% m. y; o2 ]0 x5 {3 r- otop:0; . y5 B. |! V# `
width:300px; ) u( |: _; h; Y) _
height:250px; 2 Z/ I$ A4 A7 y9 q6 }
z-index:99999;
9 T& V% S- e) B1 b( m1 V$ T} + L$ R9 ~0 d% b4 y4 G
--> 4 B3 o- K3 ~- a& D; g& Z
</style>
/ c! \# Y' c$ P: {' Z: g! u</head>
5 B: Z o0 c* [/ i9 X+ b. Z" C- I( e<body>
+ U' n q& D" G. s. s7 f+ t {<button style=width:300;height:250;background:transparent;border:o;padding:0;cursor:hand onclick=window.location.href='http://s.jb51.net'> . J. s/ d, e+ `
<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
9 c4 x% r. \* |codebase= width=100% height=100%>
( M1 d; t5 M H1 n<param name=movie value=> 1 @# M' [7 Z, [7 S- r& L- ^
<param name=quality value=high> ) J9 p6 C% q, ]9 N1 O- j- e, [
<param name=wmode value=opaque /> . @, b$ e, t) o& r
<embed src= width=300 height=250 quality=high pluginspage= type=application/x-shockwave-flash align=middle wmode=opaque> 5 f! L. j5 n* u
</embed>
- {9 F. A2 W$ y2 l) p f</object> ! f9 q) _4 E5 n7 e8 \
</button>
& D* r+ Z0 K2 v</body> 3 F' q) z) ~; v0 U r1 j) q
</html> , T d0 |4 c( Q; z# X% T& I' C
$ e' f" V9 D' |9 r, E5 M
更多网页制作信息请查看: 网页制作 |
|