我使用的图像滑块从http://codyhouse.co/gem/css-jquery-image-comparison-slider/和fullpage.js http://alvarotrigo.com/fullPage/但是,当我将jquery放在标题处时,滑块不起作用,但如果放在底部, fullPage.js无法运行,但图像比较可以。下面是代码:来自CodyHouse的图像比较滑块与fullPage.js有冲突
<link href='http://fonts.googleapis.com/css?family=EB+Garamond' rel='stylesheet' type='text/css'>
<!-- alternative to futura font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css" />
<!-- Resource jQuery -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/jquery.mobile.custom.min.js"></script>
<script src="js/main.js"></script>
<!-- https://github.com/alvarotrigo/fullPage.js#usage -->
<script type="text/javascript" src="js/jquery.fullPage.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#fullpage').fullpage({
anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', '5thpage', '6thpage', '7thpage', '8thpage', '9thpage', 'lastPage'],
continuousVertical: true,
responsiveWidth: '400',
});
});
</script>
<div id="fullpage">
<div class="section " id="section0">
<img src="img/logo.png" />
<div class="row">
</div>
<div class="row">
</div>
<div class="row">
</div>
<p><a href="#secondPage">About</a></p>
<span><a href="#3rdPage">Age</a></span>
<span><a href="#4thpage">Cosplay</a></span>
<span><a href="#5thpage">Privacy</a></span>
<span><a href="#6thpage">Romance</a></span>
<span><a href="#7thpage">School</a></span>
<span><a href="#8thpage">Son</a></span>
<span><a href="#9thpage">Time</a></span>
<span><a href="#10thpage">Vocation</a></span>
</div>
<div class="section" id="section1">
<div class="container">
<div class="row">
<img src="img/logo.png" />
</div>
<div class="row">
</div>
<div class="row">
<div class="col-xs-6 col-sm-4 justify">
<p>lorem ipsum</p>
</div>
</div>
</div>
</div>
<div class="section" id="section2">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section3">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Couple</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section4">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section5">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section6">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section7">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section8">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
<div class="section" id="section9">
<figure class="cd-image-container">
<img src="img/cosplay/v.jpg">
<div class="cd-resize-img">
<!-- the resizable image on top -->
<img src="img/cosplay/d.jpg">
</div>
<span class="cd-handle"></span>
</figure>
<!-- cd-image-container -->
<h1 class="garamond">Cosplay</h1>
<strong>D & V</strong>
</div>
</div>