教育jquery实现图片放大插件



37 147 50



特效描述:教育jquery实现 图片放大插件,教育jquery实现图片放大插件

代码结构

1. 引入CSS

<link rel="stylesheet" href="css/screen.css" media="screen"/>
<link rel="stylesheet" href="css/lightbox.css" media="screen"/>

2. 引入JS

<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/lightbox-2.6.min.js"></script>

3. HTML代码

<div class="wrapper">
	<section id="intro" class="section intro-section">
		<header>
			<h1 class="logo">Lightbox<em class="version">2.6</em></h1>
		</header>
		<p class="author">
			by Lokesh Dhakar<br />
	  </p>
		<p class="lead">
	  Lightbox是很小javascript库用来展示图片相册的插件。</p>
  </section>
	<section id="examples" class="section examples-section">
		<header>
			<h2 class="section-header">Examples</h2>
		</header>
		<h3>Single images</h3>
		<div class="image-row">
			<a class="example-image-link" href="img/demopage/image-1.jpg" data-lightbox="example-1"><img class="example-image" src="img/demopage/thumb-1.jpg" alt="thumb-1" width="150" height="150"/></a>
			<a class="example-image-link" href="img/demopage/image-2.jpg" data-lightbox="example-2" title="Optional caption."><img class="example-image" src="img/demopage/thumb-2.jpg" alt="thumb-1" width="150" height="150"/></a>
		</div>
		<h3 style="clear: both;">An image set</h3>
		<div class="image-row">
			<div class="image-set">
				<a class="example-image-link" href="img/demopage/image-3.jpg" data-lightbox="example-set" title="Click on the right side of the image to move forward."><img class="example-image" src="img/demopage/thumb-3.jpg" alt="Plants: image 1 0f 4 thumb" width="150" height="150"/></a>
				<a class="example-image-link" href="img/demopage/image-4.jpg" data-lightbox="example-set" title="Or press the right arrow on your keyboard."><img class="example-image" src="img/demopage/thumb-4.jpg" alt="Plants: image 2 0f 4 thumb" width="150" height="150"/></a>
				<a class="example-image-link" href="img/demopage/image-5.jpg" data-lightbox="example-set" title="The script preloads the next image in the set as you're viewing."><img class="example-image" src="img/demopage/thumb-5.jpg" alt="Plants: image 3 0f 4 thumb" width="150" height="150"/></a>
				<a class="example-image-link" href="img/demopage/image-6.jpg" data-lightbox="example-set" title="Click anywhere outside the image or the X to the right to close."><img class="example-image" src="img/demopage/thumb-6.jpg" alt="Plants: image 4 0f 4 thumb" width="150" height="150"/></a>
			</div>
		</div>
	</section>
	<section id="how-to-use" class="section how-to-use-section">
		<header>
			<h2 class="section-header">How to use</h2>
			<h2 class="section-subheader">Step-by-step instructions</h2>
		</header>
		<h3>Part 1 - Get setup</h3>
		<ol>
			<li>Download and unzip the latest version of Lightbox from above.</li>
			<li>Look inside the <code>js</code> folder to find <code>jquery-1.10.2.min.js</code> and <code>lightbox-2.6.min.js</code> and load both of these files from your html page. Load jQuery first:
<pre><code>&lt;script src=&quot;js/jquery-1.10.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/lightbox-2.6.min.js&quot;&gt;&lt;/script&gt;
</code></pre></li>
			<li>Look inside the <code>css</code> folder to find <code>lightbox.css</code> and load it from your html page:
<pre><code>&lt;link href=&quot;css/lightbox.css&quot; rel=&quot;stylesheet&quot; /&gt;
</code></pre>
			</li>
			<li>Look inside the <code>img</code> folder to find <code>close.png</code>, <code>loading.gif</code>, <code>prev.png</code>, and <code>next.png</code>. These files are used in <code>lightbox.css</code>. By default, <code>lightbox.css</code> will look for these images in a folder called <code>img</code>.</li>
		</ol>
		<h3>Part 2 - Turn it on</h3>
	<ul>
			<li>Add a <code>data-lightbox</code> attribute to any image link to activate Lightbox. For the value of the attribute, use a unique name for each image. For example:
<pre><code>&lt;a href=&quot;img/image-1.jpg&quot; data-lightbox=&quot;image-1&quot; title=&quot;My caption&quot;&gt;image #1&lt;/a&gt;
</code></pre>
			 <div class="sub-point"><em>Optional:</em> Set the <code>title</code> attribute if you want to show a caption.</div> </li>
			<li>If you have a group of related images that you would like to combine into a set, use the same <code>data-lightbox</code> attribute value for all of the images. For example:
<pre><code>&lt;a href=&quot;img/image-2.jpg&quot; data-lightbox=&quot;roadtrip&quot;&gt;image #2&lt;/a&gt;
&lt;a href=&quot;img/image-3.jpg&quot; data-lightbox=&quot;roadtrip&quot;&gt;image #3&lt;/a&gt;
&lt;a href=&quot;img/image-4.jpg&quot; data-lightbox=&quot;roadtrip&quot;&gt;image #4&lt;/a&gt;
</code></pre></li>
<li class="last-list-item"><div class="sub-point">For you long time Lightbox users, don't fret, you can still enable Lightbox by using <code>rel="lightbox"</code>. The new <code>data-lightbox</code> approach is preferred though as it is valid html.</div></li>
	</li>
		</ul>
	</section>
</div>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 图片翻转 图片旋转 图片叠加 图片层叠 图片延迟加载 图片延迟 图片加载 图片放大镜 头像上传 图片上传 图片拖动 图片拖拽 图片淡出淡进 图片淡出 图片淡进 二维码 图片全屏 h5图片动画 h5图标动画 html5图片动画 html5图标动画 图片广告 带缩略图的幻灯片 地图 中国地图 世界地图 图片放大缩小 图片缩放 图片大小 图片放大 图片缩小 图片变大 图片变小 纯图片轮播 图片轮播 旋转木马 图片旋转木马 文字旋转木马 旋转木马插件 图片收缩展开 图片收缩 图片展开 图片切换 图片选项卡 图标选项卡 图片滑动 图片滑块 图片滚动 图片滚动条 图标导航 图标菜单 弹出层拖动 自动滚动图片轮播 背景切换 大图切换 窗口 弹出 弹窗 弹出层 提示框 对话框 遮罩 遮罩层 弹窗插件 手风琴 水平手风琴 垂直手风琴 图片手风琴 文字手风琴 手风琴插件 放大缩小 变大变小 放大 缩小 变大 变小 缩放 缩放切换 图表 图片 图片插件 头像截图 图片放大缩小 图片缩放 图片大小 图片放大 图片缩小 图片变大 图片变小 图片相册 相册图片 lightbox

×
×

注册

官方QQ群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

加群请备注:从官网了解到