[图片 显示] 缩图循环显示(php,mysql,script)

时间:2010-01-08 15:39:56   来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:FFFFFF; text-decoration: none}.shadow1{filter: DropShadow(Color=#CCCCCC, OffX=1, OffY=1, Positive=1);text-decoration: none}2.php对script数组附值//..............读数据库相关内容$num = 0;if (file_exists( $photoName)){// $photoName为图片路径,在我前一文章里,有自动生成缩图的方法
  正文:

这几天被这问题折腾了一下,总算可以用了.
也同时给,辛苦工作的兄弟们一个提示吧:

1. .Css 增加
.shadow{filter: Drophotoshop/ target=_blank class=infotextkey>pshadow(Color=#385370, OffX=1, OffY=1, Positive=1);font-size:12px; color: #FFFFFF; text-decoration: none}
.shadow1{filter: DropShadow(Color=#CCCCCC, OffX=1, OffY=1, Positive=1);text-decoration: none}

2.PHP对script数组附值
//..............读数据库相关内容
$num = 0;
if (file_exists( $photoName)){// $photoName为图片路径,在我前一文章里,有自动生成缩图的方法
//添加script数组
 $num = $num 1;
 $imgUrlCanSwap[ $num] = "http://www.xbcb.com/". $photoName; //图片网址
 $imgLinkCanSwap[ $num] = "http://www.xbcb.com/includes/show_products.php?id=". $list_values['id']; //连接的网址
 $imgTextCanSwap[ $num]=  $list_values['name']; //标题
}
3.生成循环显示图片
<script language=JavaScript> <!--
var imgUrlCanSwap=new Array();
var imgLinkCanSwap=new Array();
var imgTextCanSwap=new Array();
var adNumCanSwap=0;
<?php
for ( $i=1;  $i<= $num;  $i ) {// $num为2.php对script数组附值的变量
?>
imgLinkCanSwap[<?php echo $i;?>] ="<? echo $imgLinkCanSwap[$i];?>";
imgUrlCanSwap[<?php echo $i;?>] ="<? echo $imgUrlCanSwap[$i];?>";
imgTextCanSwap[<?php echo $i;?>] ="<? echo $imgTextCanSwap[$i];?>";
<?
}
?>
var imgPreCanSwap=new Array();
var jCanSwap=0;
for (iCanSwap=0;iCanSwap<=imgLinkCanSwap.length - 2;iCanSwap ) {
if(imgLinkCanSwap[iCanSwap]!="") {jCanSwap ;}
else {break;}
}
function playTranCanSwap(){
if (document.all)
imgInitCanSwap.filters.revealTrans.play();
}
var keyCanSwap=0;
function nextAdCanSwap(){
if(adNumCanSwap<jCanSwap)adNumCanSwap ;
else adNumCanSwap=1;

if( keyCanSwap==0 ){keyCanSwap=1;}
else if (document.all){
imgInitCanSwap.filters.revealTrans.Transition=6;
imgInitCanSwap.filters.revealTrans.apply();
playTranCanSwap();
}
document.images.imgInitCanSwap.src=imgUrlCanSwap[adNumCanSwap];
document.images.imgInitCanSwap.alt=imgTextCanSwap[adNumCanSwap];
jumpUrlCanSwap=imgLinkCanSwap[adNumCanSwap];
theTimerCanSwap=setTimeout("nextAdCanSwap()", 5000);
if(document.all.textInitCanSwap) {
document.all.textInitCanSwap.href = imgLinkCanSwap[adNumCanSwap];
document.all.textInitCanSwap.innerText = imgTextCanSwap[adNumCanSwap];
}
}
function goUrlInitCanSwap(){
jumpTarget='_blank';
if (jumpUrlCanSwap != ''){
if (jumpTarget != '') window.open(jumpUrlCanSwap,jumpTarget);
else location.href=jumpUrlCanSwap;
}
}
//--></script>
<A onclick="javascript:goUrlInitCanSwap();return false;" href="#"><IMG style="FILTER: revealTrans(duration=2,transition=6)" src="javascript:nextAdCanSwap()" border=0 name=imgInitCanSwap></A>


来源:http://www.002pc.com/master/College/Programming/PHP/11635.html

收藏到:

关于《[图片 显示] 缩图循环显示(php,mysql,script)》文章的评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面

随机文章

    SQL Error: select * from ***_ecms_article where classid='86' and checked=1 order by rand() limit 10

顶出来的热门

    SQL Error: select * from ***_ecms_article where classid='86' and checked=1 order by diggtop desc,id desc limit 10
站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td