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)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

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.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

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.

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.

See all articles