• 简单切换图片效果


    <script type="text/javascript">
    $(document).ready(function(){
        var img=$(".box_scrollpic4 img").eq(2).attr('src');
        if($(".mainpic").attr('src')=='')
        {
        $(".mainpic").attr("src",img);
        }
        $(".box_scrollpic4 img").each(function(){    
        $(this).click(function(){
            $(".mainpic").attr("src",$(this).attr('src'));
            });
        
        });
        });
    </script>

    html 代码

    主图区域

    <img class="mainpic" width="700" border="0" height="467" alt="" src="">

    图片列表区域  <div class="box_scrollpic4" style=" line-height:18px;">

    <a href="javascript:void(0)" target="main"><img src="[field:picname]" border="0" alt="[field:title/]"></a>

    </div>

  • 相关阅读:
    11.菜单(一)
    线性表之顺序存储详解
    SVN 撤回已提交的代码
    线性表1
    顶层父类
    异常类之派生类
    new和delete重载
    异常类之基类
    Qt中多线程问题
    智能指针实例
  • 原文地址:https://www.cnblogs.com/chenfeizhou/p/3169716.html
Copyright © 2020-2023  润新知