
谁能写一个:点击就能切换图片的CSS+js的样式代码,就是一块内容里有好多张图片,图片右下角有数字能更换
3个回答
展开全部
没时间写。。。这是我曾经写过的一个自动切换图。。。
希望能够帮到你。。。。 自己动手做做。。。不懂了在问 在找答案。。。。自己会了 不用求人了
<script type="text/javascript">
$().ready(function(){
var img_msg=$("#img_msg ul li");//文字列表
var img_list=$(".img_list ul li");//图片列表
var img_tu=$(".img_tu"); //显示图片
var imgheight="175";
var imgwidth="319";
var imgstyle="here";
var speed=3000;
auto();
function auto(n){
var i=0;
imageauto=setInterval(function(){
if(i==img_list.length || n>=img_list.length){i=0;n=0}
if(typeof(n)!="undefined"){i=n;n++}
image(i);
i++;
},speed);
}
img_list.mouseenter(function(){
var index=img_list.index(this);
image(index);
clearInterval(imageauto);
auto(index+1);
}).eq(0).mouseenter();
function image(num){
img_list.eq(num).addClass(imgstyle).siblings().removeClass(imgstyle);
var imgurl=img_list.eq(num).find("img").attr("src");
var image=$(new Image).attr({src:imgurl,height:imgheight,width:imgwidth,onclick:"javascript:location.href='"+img_list.eq(num).find("img").attr("imghref")+"'"});
img_msg.eq(num).fadeIn(1000).siblings().hide();
img_tu.html(image.fadeIn(1000));
};
});
</script>
<div class="img_tu"></div>
<div class="img_list">
<ul>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
</ul>
</div>
<div id="img_msg">
<ul>
<li>标题1</li> <li>标题2</li> <li>标题3</li> <li>标题4</li> <li>标题5</li>
</ul>
</div>
希望能够帮到你。。。。 自己动手做做。。。不懂了在问 在找答案。。。。自己会了 不用求人了
<script type="text/javascript">
$().ready(function(){
var img_msg=$("#img_msg ul li");//文字列表
var img_list=$(".img_list ul li");//图片列表
var img_tu=$(".img_tu"); //显示图片
var imgheight="175";
var imgwidth="319";
var imgstyle="here";
var speed=3000;
auto();
function auto(n){
var i=0;
imageauto=setInterval(function(){
if(i==img_list.length || n>=img_list.length){i=0;n=0}
if(typeof(n)!="undefined"){i=n;n++}
image(i);
i++;
},speed);
}
img_list.mouseenter(function(){
var index=img_list.index(this);
image(index);
clearInterval(imageauto);
auto(index+1);
}).eq(0).mouseenter();
function image(num){
img_list.eq(num).addClass(imgstyle).siblings().removeClass(imgstyle);
var imgurl=img_list.eq(num).find("img").attr("src");
var image=$(new Image).attr({src:imgurl,height:imgheight,width:imgwidth,onclick:"javascript:location.href='"+img_list.eq(num).find("img").attr("imghref")+"'"});
img_msg.eq(num).fadeIn(1000).siblings().hide();
img_tu.html(image.fadeIn(1000));
};
});
</script>
<div class="img_tu"></div>
<div class="img_list">
<ul>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
<li><img src="images/1.jpg" width="48" height="30" imghref="a.html" /></li>
</ul>
</div>
<div id="img_msg">
<ul>
<li>标题1</li> <li>标题2</li> <li>标题3</li> <li>标题4</li> <li>标题5</li>
</ul>
</div>
2011-10-12
展开全部
试试这个图片切换
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码
有12345数字一起切换
鼠标点一下数字会变换到另一张图片,不点就会自动换
里面有教程和源码
参考资料: http://www.blueidea.com/common/shoutbox/redir.asp?7=p&id=10895
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询