Table of Contents
回复讨论(解决方案)
Home Web Front-end HTML Tutorial 鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose

鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose

Jun 21, 2016 am 09:47 AM



效果就是这样的,跪等啊 。。。。。。。。

回复讨论(解决方案)

要配合js去写

给这么点分,没动力啊

给这么点分,没动力啊

可以加分的 

你直接写一个img,size小一点,然后指上去,把你那个大一点的img的url变成你小的那个img的url,
如果你有分大图片和小图片的话,就直接把大的img的url变成大文件的url就可以了!

你直接写一个img,size小一点,然后指上去,把你那个大一点的img的url变成你小的那个img的url,
如果你有分大图片和小图片的话,就直接把大的img的url变成大文件的url就可以了!

能帮帮我吗  跪求啊  急死我了

<script type="text/javascript">		function aa(url){			document.getElementById("test").src=url		}	</script>	<body>		<img  src="/static/imghw/default1.png"  data-src="imgad.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%" onmouseover="aa(this.src)" / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >		<img  src="/static/imghw/default1.png"  data-src=""    style="max-width:90%"lazy"   width="100"  style="max-width:90%" id="test"/ alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >	</body>
Copy after login
Copy after login
Copy after login

你看看吧!

<script type="text/javascript">		function aa(url){			document.getElementById("test").src=url		}	</script>	<body>		<img  src="/static/imghw/default1.png"  data-src="imgad.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%" onmouseover="aa(this.src)" / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >		<img  src="/static/imghw/default1.png"  data-src=""    style="max-width:90%"lazy"   width="100"  style="max-width:90%" id="test"/ alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >	</body>
Copy after login
Copy after login
Copy after login

你看看吧!


我的意思是鼠标移动在小图上面 右边显示大图


<script type="text/javascript">		function aa(url){			document.getElementById("test").src=url		}	</script>	<body>		<img  src="/static/imghw/default1.png"  data-src="imgad.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%" onmouseover="aa(this.src)" / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >		<img  src="/static/imghw/default1.png"  data-src=""    style="max-width:90%"lazy"   width="100"  style="max-width:90%" id="test"/ alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >	</body>
Copy after login
Copy after login
Copy after login

你看看吧!


我的意思是鼠标移动在小图上面 右边显示大图
我只是给你一点实现的代码,你自己弄到你里面去啊!
我这个是上下,图片大小自己设置的.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><style type="text/css">body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,div{margin:0;padding:0}body,button,input,select,textarea{font:100%/1.5 Arial,Helvetica,tahoma,\5b8b\4f53,sans-serif}h1,h2,h3,h4,h5,h6{font-size:100%}address,cite,dfn,em,var{font-style:normal}code,kbd,pre,samp{font-family:courier new,courier,monospace}small{font-size:12px}ul,ol{list-style:none}a{text-decoration:none;color:#fff}a:hover{color:#fff;text-decoration:none}a:focus{outline:none;-moz-outline:none}sup{vertical-align:text-top}sub{vertical-align:text-bottom}legend{color:#000}fieldset,img,a{border:0 none;outline:0 none}button,input,select,textarea{font-size:100%}table{border-collapse:collapse;border-spacing:0}input,textarea{outline:none}abbr,article,aside,bb,datagrid,datalist,details,dialog,eventsource,figure,figcaption,footer,header,mark,menu,meter,nav,output,progress,section,time{display:block;height:auto}textarea{resize:none}/* 清除浮动 */.clearfix:after{clear:both;content:"\20";display:block;font-size:0;height:0;line-height:0;visibility:hidden}.clearfix{display:block;zoom:1}.box{width:1200px;position:relative}.list{margin:20px 0 0 30px}.list li{float:left;margin-right:20px}.list li img{width:120px;height:80px}.showbox{position:absolute;top:0;right:0}#showimg{width:360px;height:300px}</style><body><div class="box">    <ul class="list clearfix" id="list">        <li><img  src="/static/imghw/default1.png"  data-src="img/1.jpg"  class="lazy"   / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" ></li>        <li><img  src="/static/imghw/default1.png"  data-src="img/2.png"  class="lazy"   / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" ></li>        <li><img  src="/static/imghw/default1.png"  data-src="img/3.jpg"  class="lazy"   / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" ></li>        <li><img  src="/static/imghw/default1.png"  data-src="img/4.png"  class="lazy"   / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" ></li>        <li><img  src="/static/imghw/default1.png"  data-src="img/5.png"  class="lazy"   / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" ></li>    </ul>        <div class="showbox">        <img  src="/static/imghw/default1.png"  data-src="" id="  class="lazy"   id="showimg" / alt="鼠标移动左边的小图,右边显示大图,求大神,在线等啊!_html/css_WEB-ITnose" >    </div></div><script type="text/javascript">	var url = ""	var li = document.getElementById("list").getElementsByTagName("img");	for(var i=0; i<li.length; i++){		li[i].onmouseover = function(){			url = this.src;			document.getElementById("showimg").src = url;		}	}</script></body></html>
Copy after login

CSS就可以了 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

How to distinguish between closing a browser tab and closing the entire browser using JavaScript? How to distinguish between closing a browser tab and closing the entire browser using JavaScript? Apr 04, 2025 pm 10:21 PM

How to distinguish between closing tabs and closing entire browser using JavaScript on your browser? During the daily use of the browser, users may...

See all articles