备忘

//var IndexImgs={
//    imgIndex:0,//当前被选中的图片的下标(index)
//    internalId:0,//轮换控制 id
//    imgs:[],//所有要显示的图片
//    lis:[],//li
//    init:function(){
//        IndexImgs.imgs=[
//            {
//                alt:'',
//                src:'',
//                head:'',
//                content:''
//            },
//            {
//                alt:'',
//                src:'',
//                head:'',
//                content:''
//            },
//            {
//                alt:'',
//                src:'',
//                head:'',
//                content:''
//            },
//            {
//                alt:'',
//                src:'',
//                head:'',
//                content:''
//            },
//       
//        
//            {
//
//                alt:'',
//                src:'',
//                head:'',
//                content:''
//            }
//
//        ];
//        //生成li,并添加事件处理函数
//        for(var i=0;i<IndexImgs.imgs.length;i++){
//            var li=$("<li><img width='108' height='60' border='0' style='display:none' src='" + IndexImgs.imgs[i].src+ "' alt='" + IndexImgs.imgs[i].alt + "' /></li>");
//            $('#slidenav').append(li);
//            //li绑定功能
//            //鼠标移入移出
//            li.hover(function(){
//                $(this).children('img').show().fadeIn('fast');
//            },
//            function(){
//                $(this).children('img').hide().fadeOut('fast');
//            });
//            //绑定单击事件
//            li.bind('click',function(imgInfo,index){
//                function change(){
//                    $('#slidenav li').each(function(){
//                        $(this).removeClass('active')
//                    }); 
//                    $(this).addClass('active');
//                    IndexImgs.changeImg(imgInfo);
//                    IndexImgs.imgIndex=index;//设置当前图片index,使自动浏览时下一张图片从当前选中图片开始
//                    //点击后重新开始计时
//                    window.clearInterval(IndexImgs.internalId);
//                    IndexImgs.internalChange();
//                }
//                return change;
//            }(IndexImgs.imgs[i],i));
//
//
//            IndexImgs.lis[i]=li;//使图片与li下标一一对应
//        }
//        //初始化
//        $('#slidenav li:first').addClass('active');
//        $("#index_show_img").attr('src',IndexImgs.imgs[0].src);
//        $('#index_show_img_head').html(IndexImgs.imgs[0].head);
//        $('#index_show_img_content').html(IndexImgs.imgs[0].content);
//        //图片切换
//        IndexImgs.internalChange();
//    },
//    internalChange:function(){
//        IndexImgs.internalId=window.setInterval(function(){//从当前被选中图片开始滚动
//            IndexImgs.imgIndex=(IndexImgs.imgIndex+1)%IndexImgs.imgs.length;
//            IndexImgs.lis[IndexImgs.imgIndex].click();
//        },5000);
//    },
//    changeImg:function(img){
//        //设置图片说明;
//        $('#index_show_img_text').hide();//ie8需要这两行
//        $('#index_show_img_text').show();
//        
//        $('#index_show_img_head').html(img.head);
//        $('#index_show_img_content').html(img.content);
//        $("#index_show_img").stop().animate({
//            opacity: '.7'
//        },200);
//        setTimeout(function(){
//            $("#index_show_img").attr('src',img.src);          
//        }, 200);
//        setTimeout(function(){
//            $("#index_show_img").stop().animate({
//                opacity: '1'
//            },200);
//        },200);       
//    }
//}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值