菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 3 使用HiSRC的响应式图像实例 </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="../bootstrap/v3/dist/css/bootstrap.min.css" rel="stylesheet" media="screen"> <style> body { padding: 50px } img { margin-bottom:30px } </style> <!--[if lt IE 9]> <script src="http://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="http://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body> <img src="/wp-content/uploads/2013/12/5216852563_eca0af1b0d_m.jpg" data-1x="5216852563_eca0af1b0d.jpg" data-2x="5216852563_90c3f9c402_o.jpg" class="hisrc" /> <script src="http://code.jquery.com/jquery.js"></script> <script src="../bootstrap/v3/dist/js/bootstrap.min.js"></script> <script> $(document).ready(function(){ $(".hisrc").hisrc(); }); </script> <p>Photo curtsey: /http://www.flickr.com/photos/cubagallery/</p> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net