我试图一次加载两个不同的东西。我有单页幻灯片效果的jquery脚本,但我也试图在其中一个页面上加载一个coda滑块。它不会工作。如果我删除幻灯片jquery比coda滑块将工作。我怎样才能使它们都起作用?
答案 0 :(得分:0)
Coda Slider是一个jQuery库,因此,我们知道它不适用于jQuery脚本。 所以,请检查以下内容:
1)看看是否在所有其他的开头引用了jQuery lirbary 脚本。
2)您正在使用适当的jQuery库。
3)你的jQuery脚本没有错误。
如果你觉得每件事情都好,我想你最好添加一个不能解决这个问题的脚本。
答案 1 :(得分:0)
<!DOCTYPE html> <!-- The new doctype -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coding A CSS3 & HTML5 One Page Template | Tutorialzine demo</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!-- Internet Explorer HTML5 enabling code: -->
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<style type="text/css">
.clear {
zoom: 1;
display: block;
}
</style>
<![endif]-->
<meta charset='utf-8' />
<meta name="description" content="Codaslider : JQuery Slider Plugin" />
<!--
Here is the style sheet for the Coda Slider
You may want to "minify" this after making edits
http://www.refresh-sf.com/yui/
-->
<link rel="stylesheet" type="text/css" media="screen" href="./css/coda-slider.css">
<!-- This is just styling for the demo to make it a little less crowded at the top -->
<style>h1{margin:100px;}</style>
<!--
I would suggest using these for production, because of better caching
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js">
</script>
-->
<!-- Definitely use these for development -->
<script src="./js/jquery-1.7.2.min.js"></script>
<script src="./js/jquery-ui-1.8.20.custom.min.js"></script>
<!-- This of course is required. The full version (not .min) is also included in the js
directory -->
<script src="./js/jquery.coda-slider-3.0.min.js"></script>
<script>
$(function(){
/* Here is the slider using default settings */
$('#slider-id').codaSlider();
/* If you want to adjust the settings, you set an option
as follows:
$('#slider-id').codaSlider({
autoSlide:true,
autoHeight:false
});
*/
});
</script>
</head>
<body>
<section id="page"> <!-- Defining the #page section with the section tag -->
<header>
<div id="navbox">
<nav class="menu">
<div class="home"><a href="#page" class="current">Home<br><span
class="little">you start here</span></a></div>
<div class="about"><a href="#article1">About Us<br><span class="little">what we
do</span></a></div>
<div class="gallery"><a href="#article2">Gallery<br><span class="little">a look
inside</span></a></div>
<div class="events"><a href="#article3">Events<br><span class="little">planning
& design</span></a></div>
<div class="contact"><a href="#article4">Contact Us<br><span
class="little">more info</span></a></div>
</nav>
<div id="socialLinks">
<a href="#" class="fb">Facebook</a>
<a href="#" class="twitter">Twitter</a>
<a href="#" class="pinterest">Pinterest</a>
<a href="#" class="linkedin">LinkedIn</a>
</div>
</div>
<div id="banner">
<div class="welcome">
<h1>Hi There,</h1>
<h2>WELCOME TO MY KIDS WISH, AN UPSCALE EVENT PLANNING COMPANY SPECIALIZING IN
CHILDREN'S AND ADULT PARTIES, BABY SHOWERS, AND MORE!</h2>
<h3>Our events consist of detailed party packages complete with one of a kind decor
, unique favors, candy buffet, Characters etc… Whether you are planning a Disney
themed party for your little one, or the most elegant Adult party, My kids wish can
meet your needs. Let us do all the work while you sit back with family and friends
to enjoy....</h3>
</div>
</div>
</header>
<section id="articles"> <!-- A new section with the articles -->
<!-- Article 1 start -->
<div class="line"></div> <!-- Dividing line -->
<article id="article1">
<!-- The new article tag. The id is supplied so it can be scrolled into
view. -->
<div id="navbox1">
<nav class="menu">
<div class="home"><a href="#page">Home<br><span class="little">you start
here</span></a></div>
<div class="about"><a href="#article1">About Us<br><span class="little">what we
do</span></a></div>
<div class="gallery"><a href="#article2">Gallery<br><span class="little">a look
inside</span></a></div>
<div class="events"><a href="#article3">Events<br><span class="little">planning
& design</span></a></div>
<div class="contact"><a href="#article4">Contact Us<br><span
class="little">more info</span></a></div>
</nav>
<div id="socialLinks1">
<a href="#" class="fb">Facebook</a>
<a href="#" class="twitter">Twitter</a>
<a href="#" class="pinterest">Pinterest</a>
<a href="#" class="linkedin">LinkedIn</a>
</div>
</div>
<div class="navborder"></div>
<div class="articleBody clear">
<div class="aboutusimg"></div>
<div class="middle">
<h1>My Kids Wish is here to create an unforgetable and unique themed party.
As every child has their own individual character so does each event we create.
Bringing a childs imagination to life is what we thrive.</h1><figure>
<img src="images/cake.jpg" width="250" height="175" alt="cake"> </figure>
<h1>Our parties are very detailed and will exceed your expectations. We
specializes in parties of all ages. We'll assist with planning special occasions so
that all you'll have to do is show up! Leave the planning to us and we'll take care
of the invitations, specialty entertainment, decorations, candy buffet, setup, and
clean up!</h1>
</div>
<div class="bottom"></div>
</div>
</article>
<!-- Article 1 end -->
<!-- Article 2 start -->
<article id="article2">
<div class="ribbon-wrapper">
<div class="ribbon-front">
<nav class="menu">
<div class="home"><a href="#page">Home<br><span class="little">you start
here</span></a></div>
<div class="about"><a href="#article1">About Us<br><span class="little">what we
do</span></a></div>
<div class="gallery"><a href="#article2">Gallery<br><span class="little">a look
inside</span></a></div>
<div class="events"><a href="#article3">Events<br><span class="little">planning
& design</span></a></div>
<div class="contact"><a href="#article4">Contact Us<br><span
class="little">more info</span></a></div>
</nav> </div>
<div class="ribbon-edge-topleft"></div>
<div class="ribbon-edge-topright"></div>
<div class="ribbon-edge-bottomleft"></div>
<div class="ribbon-edge-bottomright"></div>
<div class="ribbon-back-left"></div>
<div class="ribbon-back-right"></div>
</div>
<div id="socialLinks2">
<a href="#" class="fb">Facebook</a>
<a href="#" class="twitter">Twitter</a>
<a href="#" class="pinterest">Pinterest</a>
<a href="#" class="linkedin">LinkedIn</a>
</div>
<div class="navborder"></div>
<div class="articleBody clear">
<div class="middle">
<iframe align="center" src="http://www.flickr.com/slideShow/index.gne?user_id=94896171@N07" width="785" height="500" frameBorder="0" scrolling="no"></iframe><br /><center><small>Created with <a href="http://www.flickrslideshow.com">flickr slideshow</a>.</small></center>
</div>
</div>
</article>
<!-- Article 2 end -->
<!-- Article 3 start -->
<div id="navbox3">
<nav class="menu">
<div class="home"><a href="#page">Home<br><span class="little">you start here</span></a></div>
<div class="about"><a href="#article1">About Us<br><span class="little">what we do</span></a></div>
<div class="gallery"><a href="#article2">Gallery<br><span class="little">a look inside</span></a></div>
<div class="events"><a href="#article3">Events<br><span class="little">planning & design</span></a></div>
<div class="contact"><a href="#article4">Contact Us<br><span class="little">more info</span></a></div>
</nav>
<div id="socialLinks3">
<a href="#" class="fb">Facebook</a>
<a href="#" class="twitter">Twitter</a>
<a href="#" class="pinterest">Pinterest</a>
<a href="#" class="linkedin">LinkedIn</a>
</div>
</div>
<div class="articleBody clear">
<div class="middle">
<div class="coda-slider" id="slider-id">
<div>
<h2 class="title">Panel 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. Nam blandit felis non neque cursus aliquet. Morbi vel enim dignissim massa dignissim commodo vitae quis tellus. Nunc non mollis nulla. Sed consectetur elit id mi consectetur bibendum. Ut enim massa, sodales tempor convallis et, iaculis ac massa. Etiam suscipit nisl eget lorem pellentesque quis iaculis mi mattis. Aliquam sit amet purus lectus. Maecenas tempor ornare sollicitudin.</p>
</div>
<div>
<h2 class="title">Panel 2</h2>
<p>Proin nec turpis eget dolor dictum lacinia. Nullam nunc magna, tincidunt eu porta in, faucibus sed magna. Suspendisse laoreet ornare ullamcorper. Nulla in tortor nibh. Pellentesque sed est vitae odio vestibulum aliquet in nec leo.</p>
</div>
<div>
<h2 class="title">Panel 3</h2>
<p>Cras luctus fringilla odio vel hendrerit. Cras pulvinar auctor sollicitudin. Sed lacus quam, sodales sit amet feugiat sit amet, viverra nec augue. Sed enim ipsum, malesuada quis blandit vel, posuere eget erat. Sed a arcu justo. Integer ultricies, nunc at lobortis facilisis, ligula lacus vestibulum quam, id tincidunt sapien arcu in velit. Vestibulum consequat augue et turpis condimentum mollis sed vitae metus. Morbi leo libero, tincidunt lobortis fermentum eget, rhoncus vel sem. Morbi varius viverra velit vel tempus. Morbi enim turpis, facilisis vel volutpat at, condimentum quis erat. Morbi auctor rutrum libero sed placerat. Etiam ipsum velit, eleifend in vehicula eu, tristique a ipsum. Donec vitae quam vel diam iaculis bibendum eget ut diam. Fusce quis interdum diam. Ut urna justo, dapibus a tempus sit amet, bibendum at lectus. Sed venenatis molestie commodo.</p>
</div>
<div>
<h2 class="title">Panel 4</h2>
<p>Nulla ultricies ornare erat, a rutrum lacus varius nec. Pellentesque vehicula lobortis dignissim. Ut scelerisque auctor eros sed porttitor. Nullam pulvinar ultrices malesuada. Quisque lobortis bibendum nisi et condimentum. Mauris quis erat vel dui lobortis dignissim.</p>
</div>
</div>
</div>
</div>
</article>
<!-- Article 3 end -->
<!-- Article 4 start -->
<div id="navbox4">
<nav class="menu">
<div class="home"><a href="#page">Home<br><span class="little">you start here</span></a></div>
<div class="about"><a href="#article1">About Us<br><span class="little">what we do</span></a></div>
<div class="gallery"><a href="#article2">Gallery<br><span class="little">a look inside</span></a></div>
<div class="events"><a href="#article3">Events<br><span class="little">planning & design</span></a></div>
<div class="contact"><a href="#article4">Contact Us<br><span class="little">more info</span></a></div>
</nav>
<div id="socialLinks4">
<a href="#" class="fb">Facebook</a>
<a href="#" class="twitter">Twitter</a>
<a href="#" class="pinterest">Pinterest</a>
<a href="#" class="linkedin">LinkedIn</a>
</div>
</div>
<div class="navborder"></div>
<div class="articleBody clear">
</div>
</article>
<!-- Article 4 end -->
</section>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="js/jquery.scrollTo-min.js"></script>
<script src="script.js"></script>
</section>
</body>