一款迷你型的flash效果和大家分享下。
0、请不要问“在不在”之类的问题,有问题直接问!1、学生或暂时没有工作的童鞋,整站资源免费下载!2、¥9.9充值终身VIP会员,加我微信,826096331 拉你进VIP群学习!3、程序员加油,技术改变世界。在线 充值
首先我们定义好要轮播的幻灯片数组
$arr = array(
0 => array(
"img" => "http://www.erdangjiade.com/jquery/demo/205/images/1.jpg",
"link" => "http://www.erdangjiade.com/js",
"title" => "owlCarousel足球世界杯",
"description" => "之前演示了jQuery+Owl Carousel仿百度百科2014图。"
),
1 => array(
"img" => "http://www.erdangjiade.com/jquery/demo/205/images/2.jpg",
"link" => "http://www.erdangjiade.com/js",
"title" => "jQuery下拉框效果 ",
"description" => "Combo Select 是一款简单漂亮的下拉框SELECT搜索插件"
),
2 => array(
"img" => "http://www.erdangjiade.com/jquery/demo/205/images/3.jpg",
"link" => "http://www.erdangjiade.com/js/144.html",
"title" => "jQuery淘宝订单星级评分",
"description" => "最近一个小项目需要一个星级评分的效果。"
)
);
foreach ($arr as $v) {
$picsArr[] = $v['img'];
$titleArr[] = $v['title'];
$linkArr[] = $v['link'];
$descriptionArr[] = $v['description'];
}
$pics = implode("###", $picsArr);
$titles = implode("###", $titleArr);
$links = implode("###", $linkArr);
$descriptions = implode("###", $descriptionArr);
引入swfobject.js
<script type="text/javascript" src="swfobject.js"></script>
flash调用
var focus_width = 320;
var focus_height = 210;
var text_height = 0;
var swf_height = focus_height + 0;
var pics = "<?php echo $pics; ?>";
var links = "<?php echo $links; ?>";
var texts = "<?php echo $titles; ?>";
var descripts = "<?php echo $descriptions; ?>";
var fo = new SWFObject("pix.swf", "_FocusObj", focus_width, swf_height, "7", "F6F8FA");
fo.addVariable("pics", pics);
fo.addVariable("links", links);
fo.addVariable("texts", texts);
fo.addVariable("descripts", descripts);
fo.addVariable("borderwidth", focus_width);
fo.addVariable("borderheight", focus_height);
//fo.addVariable("textheight", text_height);
fo.addVariable("border_color", "#666");
//fo.addVariable("fontsize", "24");
//fo.addVariable("fontcolor", "FFFFFF");
fo.addVariable("is_border", "");
fo.addVariable("is_text", "1");
fo.addParam("wmode", "opaque");
fo.write("FocusObj");
提示:里面的标题、链接、描述、图片等都是用###隔开,你也可以用js二维数组来实现。
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群