タイトルは前の 2 つの記事と同じですが、この記事では、画像セットを表示する効果は次のとおりです。
1. 詳細な画像とサムネイルの同期表示。
2. 画像の自動再生3. 画像のミニチュア表示と他の画像のカバー表示を表示します。
4. マウスを詳細画像表示コントロール コントロールに移動します。
参考までに、私が実装したコードを以下に掲載します。
1. showimg.css
html, body{ height: 100%; margin: 0; padding: 0; text-align: center;}#prev{ position: absolute; top: 125px; left: 0px; width: 45px; height: 50px; background: url(../img/prev.png);}#next{ position: absolute; top: 125px; right: 0px; width: 45px; height: 50px; background: url(../img/next.png);}#prev:hover,#next:hover{ cursor: pointer;}.detail-div{ position: relative; display:inline-block; padding:4px; margin:0 0.5rem 1rem 0.5rem 1rem; line-height:0; -webkit-transition:background-color 0.1s ease-out; -moz-transition:background-color 0.1s ease-out; -o-transition:background-color 0.1s ease-out; transition:background-color 0.1s ease-out; -webkit-border-radius:6px; -moz-border-radius:6px; -ms-border-radius:6px; -o-border-radius:6px; border-radius:6px;}.thumb-div{ position: absolute; bottom: -110px; left: 4px; background: #555;}.thumb{ margin-left: 7px; margin-top: 5px; margin-bottom: 5px; float: left; position: relative;}.thumb-img{ -webkit-border-radius:5px; -moz-border-radius:5px; -ms-border-radius:5px; -o-border-radius:5px; border-radius:5px}.thumb-active{ border: 2px solid #fff; -webkit-border-radius:5px; -moz-border-radius:5px; -ms-border-radius:5px; -o-border-radius:5px; border-radius:5px; height: 100px;}.thumb-modal{ background: #141414; opacity: 0.5; filter:alpha(opacity=50); position: absolute; left: 0px; bottom: 2px; -webkit-border-radius:5px; -moz-border-radius:5px; -ms-border-radius:5px; -o-border-radius:5px; border-radius:5px;}.thumb-modal-hide{ display: none;}2. juqery.showimg.js
(function($){ $.fn.showImg = function(options){ var defaults = {}; var options = $.extend(defaults, options); var container=$(this); var imgUrls = options.imgUrls; var width = options.width,height = options.height,thumbHeight = options.thumbHeight; var autoPlay = options.autoplay; container.css("width",width+"px"); var imgIndex = 1,length = imgUrls.length; var play; /** * 图片详情 */ var detailDiv = $("<div></div>").addClass("detail-div").appendTo(container); var ctrlDiv = $("<div></div>").appendTo(detailDiv).hide(); var prevA = $("<a></a>").attr("id","prev").appendTo(ctrlDiv).hide(), nextA = $("<a></a>").attr("id","next").appendTo(ctrlDiv); $(".detail-div").live("mouseenter",function(){ play = clearInterval(play); ctrlDiv.show(); }); $(".detail-div").live("mouseleave",function(){ play = setInterval(playImg,3000); ctrlDiv.hide(); }); var detailImgA = $("<a></a>").appendTo(detailDiv); var detailImg = $("<img src="/static/imghwm/default1.png" data-src="js/jquery-1.8.3.js" class="lazy" alt="CSS+JSで画像コレクション表示を実現(2)_html/css_WEB-ITnose" >").attr("id","detailImg") .attr("width",width) .attr("height",height) .attr("src","img/demopage/image-"+imgIndex+".jpg") .appendTo(detailImgA); /** * 缩影图片 */ var thumbDiv = $("<div></div>").addClass("thumb-div") .appendTo(container) .css("width",width+"px"); addThumbImgs(); prevA.on("click",function(){ imgCtrlFun("prev"); }); nextA.on("click",function(){ imgCtrlFun("next"); }); if(autoPlay){ play = setInterval(playImg,3000); } function playImg(){ if(imgIndex===length){ imgIndex=0; } nextA.click(); } /** * 图片控制 * @param type */ function imgCtrlFun(type){ if(type==="prev"){ if(imgIndex>1){ imgIndex= imgIndex-1; } } else{ if(imgIndex<length imgindex="imgIndex+1;" thumbdiv.html addthumbimgs if else function var thumbwidth="width/3-10;" for i="imgIndex-2;i<img" src="/static/imghwm/default1.png" data-src="js/jquery-1.8.3.js" class="lazy" index thumb='$("<div'>").addClass("thumb").appendTo(thumbDiv); var thumbModalDiv = $("<div></div>").addClass("thumb-modal").appendTo(thumb); thumbModalDiv.css("height",thumbHeight+"px") .css("width",thumbWidth+"px"); var thumbImg = $("<img src="/static/imghwm/default1.png" data-src="js/jquery-1.8.3.js" class="lazy" alt="CSS+JSで画像コレクション表示を実現(2)_html/css_WEB-ITnose" >").attr("id","thumb"+(i+1)) .attr("width",thumbWidth) .attr("height",thumbHeight) .addClass("thumb-img") .appendTo(thumb); if(!(i 3. Index.html <br><p> </p> <p> </p> <pre name="code" class="sycode"> <meta charset="utf-8"> <title>Image List</title> <link rel="stylesheet" href="css/showimg.css"> <style> .container{ position: relative; text-align: center; margin-left: 25%; } </style> <script></script> <script src="js/jquery.showimg.js"></script> <script> var imgUrls = new Array( "img/demopage/image-1.jpg", "img/demopage/image-2.jpg", "img/demopage/image-3.jpg", "img/demopage/image-4.jpg", "img/demopage/image-5.jpg" ); $(document).ready(function (){ $('#container').showImg({ imgUrls:imgUrls, width:600, height:300, thumbHeight:100, autoplay:true }); }); </script><div id="container" class="container"></div>アイデアは非常にシンプルです。読みました ただ知っていますコードは何ですか? アイデア、これが皆さんのお役に立ち、インスピレーションを提供できることを願っています。
ダウンロードアドレス
QQ: 1004740957
Emai: niujp08@qq.com

webdevelopmentReliesOnhtml、css、andjavascript:1)htmlStructuresContent、2)cssStylesit、および3)Javascriptaddsinteractivity、形成、

HTMLの役割は、タグと属性を使用してWebページの構造とコンテンツを定義することです。 1。HTMLは、読みやすく理解しやすいようなタグを介してコンテンツを整理します。 2。アクセシビリティとSEOを強化するには、セマンティックタグなどを使用します。 3. HTMLコードの最適化により、Webページの読み込み速度とユーザーエクスペリエンスが向上する可能性があります。

HTML、CSS、およびJavaScriptは、Web開発の3つの柱です。 1。HTMLは、Webページ構造を定義し、などなどのタグを使用します。2。CSSは、色、フォントサイズなどのセレクターと属性を使用してWebページスタイルを制御します。

HTMLはWeb構造を定義し、CSSはスタイルとレイアウトを担当し、JavaScriptは動的な相互作用を提供します。 3人はWeb開発で職務を遂行し、共同でカラフルなWebサイトを構築します。

HTMLは、簡単に学習しやすく、結果をすばやく見ることができるため、初心者に適しています。 1)HTMLの学習曲線はスムーズで簡単に開始できます。 2)基本タグをマスターして、Webページの作成を開始します。 3)柔軟性が高く、CSSおよびJavaScriptと組み合わせて使用できます。 4)豊富な学習リソースと最新のツールは、学習プロセスをサポートしています。

Anexampleapalofastartingtaginhtmlis、それはaperginsaparagraph.startingtagsaresentionentientiontheyinitiateelements、definetheirtypes、およびarecrucialforurturingwebpagesandcontingthomedomを構築します。

メニューで点線のラインセグメンテーション効果を設計する方法は?メニューを設計するときは、通常、皿の名前と価格の間に左右に合わせることは難しくありませんが、真ん中の点線またはポイントはどうですか...


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

ZendStudio 13.5.1 Mac
強力な PHP 統合開発環境

DVWA
Damn Vulnerable Web App (DVWA) は、非常に脆弱な PHP/MySQL Web アプリケーションです。その主な目的は、セキュリティ専門家が法的環境でスキルとツールをテストするのに役立ち、Web 開発者が Web アプリケーションを保護するプロセスをより深く理解できるようにし、教師/生徒が教室環境で Web アプリケーションを教え/学習できるようにすることです。安全。 DVWA の目標は、シンプルでわかりやすいインターフェイスを通じて、さまざまな難易度で最も一般的な Web 脆弱性のいくつかを実践することです。このソフトウェアは、

WebStorm Mac版
便利なJavaScript開発ツール

Safe Exam Browser
Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。
