• 基于jQuery的新浪游戏首页幻灯片


    分享一款基于jQuery的新浪游戏首页幻灯片,带左右箭头,选项卡缩略图,自动轮播切换的jQuery幻灯片代码。效果图如下:

    在线预览    源码下载

    实现的代码。

    html代码:

    Html代码  收藏代码
    1. <br><center>  
    2.         <div class='Homeslide'>  
    3.             <div class='Homeslide_bigwrap'>  
    4.                 <div class='Homeslide_hand0'></div>  
    5.                 <div class='Homeslide_hand1'></div>  
    6.                 <target='_blank' class='Homeslide_bigpicdiv_mask'>loading...</a>  
    7.                 <div class='Homeslide_bigpicdiv'>  
    8.                     <href='#' target='_blank'><img src=""></a>  
    9.                 </div>  
    10.                 <div class='Homeslide_detail'>  
    11.                     <p>loading...</p>  
    12.                     <div class='Homeslide_ralate'>loading...</div>  
    13.                 </div>  
    14.             </div>  
    15.             <div class='Homeslide_thumb'>  
    16.                 <ul>loading...</ul>  
    17.             </div>  
    18.         </div>  
    19.     </center>  
    20.     <script type="text/javascript">  
    21.         //data  
    22.         var home_slide_data =  
    23.       [{ "title": "站长素材", "url": "http://sc.chinaz.com/", "subtitle": "u8f66u6a21u81eau7206u6c89u8ff7LOL", "image": "images/mB6w-fxesftz6773752.jpg", "thumb": "images/vhPm-fxesfuc3549394.jpg", "summary": "2015u5e74CJu5373u5c06u5f00u5e55u5728u5373uff0cu867du7136u7531u4e8eu79cdu79cdu65b0u89c4uff0cu6211u4eecu53efu80fdu518du4e5fu89c1u4e0du5230u79cdu79cdu798fu5229", "related_title_1": "u6d77u8d3cu5973u5e1du5199u771f", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u5973u661fu4ee3u8a00u624bu6e38", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "App Storeu7f16u8f91u63a8u8350u516du6708u6700u4f73u6e38u620fu76d8u70b9", "url": "http://sc.chinaz.com/", "subtitle": "u516du6708u6700u4f73u624bu6e38u76d8u70b9", "image": "images/Hv1z-fxesfty0407358.jpg", "thumb": "images/T4s2-fxesssr5451139.jpg", "summary": "u6bcfu6708App Storeu7684u7f16u8f91u90fdu4f1au5728u5f53u6708u6700u4ee4u4ebau96beu5fd8u3001u5236u4f5cu6700u7cbeu826fu7684u65b0u4f5cu4e2du627eu51fau6700u68d2u7684u6e38u620fuff0cu4e0bu9762u8ba9u6211u4e00u8d77u6765u770bu770bu6709u54eau4e9bu6e38u620fu5165u9009u516du6708u6700u4f73u5462uff1f", "related_title_1": "u5200u950bu9177u8dd1", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u8f90u5c04u907fu96beu6240", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "u9b54u517du4e16u754cu7535u5f71u9884u544au7247 7u670811u65e5u4eaeu76f8u5723u5730u4e9au54e5u52a8u6f2bu5c55", "url": "http://sc.chinaz.com/", "subtitle": "u9b54u517du7535u5f71u5468u516du516cu5e03", "image": "images/lwuY-fxesfty0408487.jpg", "thumb": "images/vfi3-fxesfuc3551167.jpg", "summary": "u6765u81eau4e8eEntertainment Weeklyu7684u6700u65b0u6d88u606fuff0cu9b54u517du4e16u754cu7535u5f71u5c06u4e8e7u670811u65e5u7684u5723u5730u4e9au54e5u56fdu9645u52a8u6f2bu5c55u4e0au516cu5e03u3002", "related_title_1": "u9ed1u6697u4e4bu95e8u6d77u62a5", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u5bfcu6f14COSu517du4eba", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "Gu676fu6e38u620fu5973u795eu5353u6bd3u5f64u8fd1u65e5u7ed9u529bu79c1u7167 u5f15u5b85u7537u75afu72c2u55b7u8840", "url": "http://sc.chinaz.com/", "subtitle": "u6e38u620fu5973u795eu7ed9u529bu79c1u7167", "image": "images/-Gtx-fxesftz6781939.jpg", "thumb": "images/vJpT-fxesftz6781941.jpg", "summary": "u8fd1u65e5u6211u4eecu7684u5973u795eu53c8u4e3au5b85u7537u4eecu653eu9001u4e86u4e00u5927u6ce2u7ed9u529bu79c1u7167uff0cu5f15u5f97u5b85u7537u73a9u5bb6u53e3u6c34u6d9fu6d9fuff0cu5c0fu4f19u4f34u4eecu968fu7740u5c0fu7f16u4e00u8d77u6765u6b23u8d4fu5427uff01", "related_title_1": "u4ee3u8a00u6e38u620fu8d70u7ea2", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u5b85u7537u7f8eu80f8u5973u795e", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "u4e00u5468u624bu6e38u5f00u6d4bu9884u544auff1au300au4e5du9634u771fu7ecfu300bu5220u6863u6d4bu8bd5", "url": "http://sc.chinaz.com/", "subtitle": "u7f8eu56fdu5927u7247u6539u7f16u624bu6e38", "image": "images/znaY-fxesfty0426946.jpg", "thumb": "images/xOeg-fxesfuc3555437.jpg", "summary": "u53c8u5230u4e86u4e00u5468u5f00u6d4bu624bu6e38u63a8u8350u7684u65f6u95f4uff0cu4f60u51c6u5907u597du4e86u5417uff01u672cu5468u5f00u6d4bu7684u624bu6e38u79cdu7c7bu7e41u591auff0cu6709u89d2u8272u626eu6f14u7c7bu4e5du9634u771fu7ecfu548cu82cdu7a79u53d8", "related_title_1": "u4e5du9634u771fu7ecf", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u7eddu5730u6218u8b66", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "u300au5251u6e7eu4f20u5947u300bu516cu5e03u5168u65b0u6e38u620fu6f14u793a u73a9u5bb6u53efu81eau5df1u5efau5730u4e0bu57ce", "url": "http://sc.chinaz.com/", "subtitle": "u5251u6e7eu4f20u5947u6700u65b0u89c6u9891", "image": "images/_UYH-fxesfty0422934.jpg", "thumb": "images/ohtY-fxesssr5454722.jpg", "summary": "u300au5251u6e7eu4f20u5947u300bu4ecau5929u516cu5e03u4e86u5168u65b0u7684u6e38u620fu89c6u9891uff0cu5c55u793au4e86u6e38u620fu4e2du6781u4e3au7075u6d3bu7684u6218u5f79u521bu5efau5de5u5177u548cu526fu672cu5927u5e08u6e38u620fu8fc7u7a0b", "related_title_1": "u65b0u6e38u620fu6a21u5f0f", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u5b9eu673au6e38u620fu89c6u9891", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "u300au6211u7684u4e16u754cuff1au6545u4e8bu6a21u5f0fu300bu5ba3u4f20u89c6u9891u9996u66dd", "url": "http://sc.chinaz.com/", "subtitle": "u6211u7684u4e16u754cu6545u4e8bu6a21u5f0f", "image": "images/ui2t-fxesftz6772647.jpg", "thumb": "images/nvsq-fxesftz6772653.jpg", "summary": "u300au6211u7684u4e16u754cu300bu53efu8c13u65f6u4e0bu6700u70edu95e8u7684u6e38u620fuff0cu51edu501fu7740u8fd9u6b3eu795eu4f5cuff0cMojang u540du58f0u5927u632fuff0cu5faeu8f6fu751au81f3u65a5u5de8u8d44u5c06u5176u6536u8d2d", "related_title_1": "u767bu5f55WIN10", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u94f6u9b42u4e71u5165", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }, { "title": "站长素材", "url": "http://sc.chinaz.com/  ", "subtitle": "u519bu653fu6218u7565u624bu6e38u66ddu5149", "image": "images/fcRo-fxesfuc3549534.jpg", "thumb": "images/JHpf-fxesftz6773913.jpg", "summary": "u4e71u4e16u4e89u9738uff0cu91d1u6208u94c1u9a6cuff0cu6562u95eeu8c01u80fdu4e00u7edfu5c71u6cb3uff1fu5982u4ecauff0cu65b0u7684u5386u53f2u5373u5c06u7531u4f60u4e66u5199uff0cu519bu653fu6218u7565u624bu6e38u300au7387u571fu4e4bu6ee8u300bu5373u5c06u5c01u6d4buff01", "related_title_1": "u9ad8u901fu6e38u620fu4e0bu8f7d", "related_image_1": "http://sc.chinaz.com/", "related_title_2": "u66f4u591au624bu6e38u8d44u8baf", "related_image_2": "http://sc.chinaz.com/", "mark": "0" }];  
    24.         //console.log(home_slide_data);  
    25.         //实例化...................................  
    26.         $('.Homeslide').homeslide(home_slide_data, true, 3000);  
    27.     </script>  

     css代码:

    Html代码  收藏代码
    1. /*通用全局设定*/  
    2.         body, input, button, select, textarea, table {  
    3.             font: 12px "Microsoft YaHei", "微软雅黑", "SimSun", "宋体";  
    4.         }  
    5.   
    6.         body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {  
    7.             margin: 0;  
    8.             padding: 0;  
    9.         }  
    10.   
    11.         fieldset, img {  
    12.             border: 0;  
    13.         }  
    14.   
    15.         table {  
    16.             border-collapse: collapse;  
    17.             border-spacing: 0;  
    18.         }  
    19.   
    20.         ol, ul {  
    21.             list-style: none;  
    22.         }  
    23.   
    24.         input, button, select, textarea {  
    25.             outline: none;  
    26.         }  
    27.   
    28.         textarea {  
    29.             resize: none;  
    30.         }  
    31.   
    32.         a:link, a:visited, a:hover, a:active {  
    33.             text-decoration: none;  
    34.         }  
    35.         /*幻灯*/  
    36.         .Homeslide {  
    37.              490px;  
    38.             height: 425px;  
    39.             color: #666565;  
    40.             overflow: hidden;  
    41.             position: relative;  
    42.         }  
    43.   
    44.         .Homeslide_hand0 {  
    45.              37px;  
    46.             height: 53px;  
    47.             position: absolute;  
    48.             left: 0;  
    49.             top: 93px;  
    50.             background: url(http://n.sinaimg.cn/game/homepage/home_slide.png) 0 -53px;  
    51.             cursor: pointer;  
    52.         }  
    53.   
    54.             .Homeslide_hand0:hover {  
    55.                 background-position: 0 0;  
    56.             }  
    57.   
    58.         .Homeslide_hand1 {  
    59.              37px;  
    60.             height: 53px;  
    61.             position: absolute;  
    62.             right: 0;  
    63.             top: 93px;  
    64.             background: url(http://n.sinaimg.cn/game/homepage/home_slide.png) -37px -53px;  
    65.             cursor: pointer;  
    66.         }  
    67.   
    68.             .Homeslide_hand1:hover {  
    69.                 background-position: -37px 0;  
    70.             }  
    71.   
    72.         .Homeslide_bigwrap {  
    73.              490px;  
    74.             height: 318px;  
    75.             position: relative;  
    76.         }  
    77.   
    78.         .Homeslide_bigpicdiv {  
    79.              490px;  
    80.             height: 248px;  
    81.         }  
    82.   
    83.         .Homeslide_bigpicdiv_mask {  
    84.             display: block;  
    85.              100%;  
    86.             height: 40px;  
    87.             line-height: 40px;  
    88.             font-size: 16px;  
    89.             text-indent: 15px;  
    90.             position: absolute;  
    91.             left: 0;  
    92.             top: 209px;  
    93.             color: #fff;  
    94.             background: url(http://n.sinaimg.cn/game/homepage/home_slide.png) 0 74px;  
    95.         }  
    96.   
    97.         .Homeslide_bigpicdiv img {  
    98.              100%;  
    99.             height: 248px;  
    100.         }  
    101.   
    102.         .Homeslide_detail {  
    103.             height: 70px;  
    104.             border-left: 1px solid #d2d2d2;  
    105.             border-right: 1px solid #d2d2d2;  
    106.             line-height: 2em;  
    107.         }  
    108.   
    109.             .Homeslide_detail p {  
    110.                  310px;  
    111.                 padding: 10px 25px 0 15px;  
    112.                 float: left;  
    113.                 height: 52px;  
    114.                 overflow: hidden;  
    115.             }  
    116.   
    117.         .Homeslide_ralate {  
    118.             height: 36px;  
    119.             border-left: 1px solid #d2d2d2;  
    120.             line-height: 1;  
    121.             float: left;  
    122.             padding-left: 26px;  
    123.             margin-top: 16px;  
    124.         }  
    125.   
    126.             .Homeslide_ralate a {  
    127.                 color: #ff6600;  
    128.             }  
    129.   
    130.         .Homeslide_thumb {  
    131.             height: 106px;  
    132.             border: 1px solid #d2d2d2;  
    133.             border-top: none;  
    134.             background: #f2f2f2;  
    135.             position: relative;  
    136.         }  
    137.   
    138.         .Homeslide_angle {  
    139.              13px;  
    140.             height: 7px;  
    141.             position: absolute;  
    142.             left: 55px;  
    143.             top: -7px;  
    144.             overflow: hidden;  
    145.             display: none;  
    146.             background: url(http://n.sinaimg.cn/game/homepage/angle.gif) -1px -1px;  
    147.         }  
    148.   
    149.         .Homeslide_thumb ul {  
    150.             position: absolute;  
    151.             left: 0;  
    152.             top: 0;  
    153.              10000px;  
    154.         }  
    155.   
    156.         .Homeslide_thumb li {  
    157.              122px;  
    158.             height: 95px;  
    159.             float: left;  
    160.             text-align: center;  
    161.             line-height: 12px;  
    162.             cursor: pointer;  
    163.             position: relative;  
    164.             padding-top: 11px;  
    165.             color: #474747;  
    166.         }  
    167.   
    168.             .Homeslide_thumb li.this {  
    169.                 background: #d2d2d2;  
    170.             }  
    171.   
    172.                 .Homeslide_thumb li.this .Homeslide_angle {  
    173.                     display: block;  
    174.                 }  
    175.   
    176.             .Homeslide_thumb li img {  
    177.                  100px;  
    178.                 height: 59px;  
    179.                 display: block;  
    180.                 margin: 0 auto;  
    181.                 margin-bottom: 13px;  
    182.             }  

     via:http://www.w2bc.com/article/49700

  • 相关阅读:
    搭建kafka集群
    fluentd 安装、配置、使用介绍
    彻底解决 es 的 unassigned shards 症状
    nginx 反向代理时丢失端口的解决方案
    kubernetes的imagePullSecrets如何生成及使用
    创建MySQL数据库账号
    Linux中查找文件
    Linux快速访问多个目录
    Django查询数据库返回字典dict数据
    linux 将压缩包复制到另外一个文件夹下面
  • 原文地址:https://www.cnblogs.com/gongcheng9990/p/4671146.html
Copyright © 2020-2023  润新知