Twitter Bootstrap 3.3.4 在 safari 7.1.3 中从本地文件显示时轮播图像不起作用
Twitter Bootstrap 3.3.4 carousel images not working when displaying from local file in safari 7.1.3
Twitter Bootstrap 3.3.4 轮播图片在 safari 7.1.3 中来自本地文件或文件夹时无法加载,这是为什么。当我尝试使用来自浏览器位置的图像时,它会显示图像。在我的例子中,我想从本地 file/folder 加载轮播中的图像。
我包括了
之类的所有内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN">
<script src="js/bootstrap-carousel.js"></script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<img src="image/1.jpg"> <!--this is how i am using img tag in html to display from local file-->
编辑:-
<!DOCTYPE HTML>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Modern Business - Start Bootstrap Template</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/modern-business.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap-carousel.js"></script> <![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Start Bootstrap</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="services.html">Services</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Portfolio <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="portfolio-1-col.html">1 Column Portfolio</a>
</li>
<li>
<a href="portfolio-2-col.html">2 Column Portfolio</a>
</li>
<li>
<a href="portfolio-3-col.html">3 Column Portfolio</a>
</li>
<li>
<a href="portfolio-4-col.html">4 Column Portfolio</a>
</li>
<li>
<a href="portfolio-item.html">Single Portfolio Item</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Blog <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="blog-home-1.html">Blog Home 1</a>
</li>
<li>
<a href="blog-home-2.html">Blog Home 2</a>
</li>
<li>
<a href="blog-post.html">Blog Post</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Other Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="full-width.html">Full Width Page</a>
</li>
<li>
<a href="sidebar.html">Sidebar Page</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="404.html">404</a>
</li>
<li>
<a href="pricing.html">Pricing Table</a>
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Header Carousel -->
<header id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src=“image/hampster%20on%20rope.jpg”>
<div class="carousel-caption">
<h2>Caption 1</h2>
</div>
</div>
<div class="item">
<img src=“image/hampster%20on%20rope.jpg">
<div class="carousel-caption">
<h2>Caption 2</h2>
</div>
</div>
<div class="item">
<img src=“image/hampster%20on%20rope.jpg">
<div class="carousel-caption">
<h2>Caption 3</h2>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</header>
任何帮助将不胜感激。
非常感谢。
首先加载一个jquery库,然后加载bootstrap-carousel.js文件,因为bootstrap-carousel.js依赖于jquery库
并且还使用了html5 doctype
尝试
<!DOCTYPE html>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap-carousel.js"></script>
编辑:
引用符号不同
替换这个
<img src=“image/hampster%20on%20rope.jpg”>
到
<img src="image/hampster%20on%20rope.jpg">
Twitter Bootstrap 3.3.4 轮播图片在 safari 7.1.3 中来自本地文件或文件夹时无法加载,这是为什么。当我尝试使用来自浏览器位置的图像时,它会显示图像。在我的例子中,我想从本地 file/folder 加载轮播中的图像。
我包括了
之类的所有内容<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN">
<script src="js/bootstrap-carousel.js"></script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<img src="image/1.jpg"> <!--this is how i am using img tag in html to display from local file-->
编辑:-
<!DOCTYPE HTML>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Modern Business - Start Bootstrap Template</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/modern-business.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap-carousel.js"></script> <![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Start Bootstrap</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="services.html">Services</a>
</li>
<li>
<a href="contact.html">Contact</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Portfolio <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="portfolio-1-col.html">1 Column Portfolio</a>
</li>
<li>
<a href="portfolio-2-col.html">2 Column Portfolio</a>
</li>
<li>
<a href="portfolio-3-col.html">3 Column Portfolio</a>
</li>
<li>
<a href="portfolio-4-col.html">4 Column Portfolio</a>
</li>
<li>
<a href="portfolio-item.html">Single Portfolio Item</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Blog <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="blog-home-1.html">Blog Home 1</a>
</li>
<li>
<a href="blog-home-2.html">Blog Home 2</a>
</li>
<li>
<a href="blog-post.html">Blog Post</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Other Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="full-width.html">Full Width Page</a>
</li>
<li>
<a href="sidebar.html">Sidebar Page</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="404.html">404</a>
</li>
<li>
<a href="pricing.html">Pricing Table</a>
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Header Carousel -->
<header id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src=“image/hampster%20on%20rope.jpg”>
<div class="carousel-caption">
<h2>Caption 1</h2>
</div>
</div>
<div class="item">
<img src=“image/hampster%20on%20rope.jpg">
<div class="carousel-caption">
<h2>Caption 2</h2>
</div>
</div>
<div class="item">
<img src=“image/hampster%20on%20rope.jpg">
<div class="carousel-caption">
<h2>Caption 3</h2>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</header>
任何帮助将不胜感激。
非常感谢。
首先加载一个jquery库,然后加载bootstrap-carousel.js文件,因为bootstrap-carousel.js依赖于jquery库
并且还使用了html5 doctype
尝试
<!DOCTYPE html>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap-carousel.js"></script>
编辑: 引用符号不同
替换这个
<img src=“image/hampster%20on%20rope.jpg”>
到
<img src="image/hampster%20on%20rope.jpg">