samedi 28 juin 2014

jquery mobile slider doesn't display on second section


Vote count:

0




I want to add a slide show using Jquery to my App. i'm using sections in my html code, and my problem is that: When i place the relevant slider code () on the first section everything work as acpected.


but when I place the code on the second section I don't see the images slides..



<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>??-?? ??"?</title>
<link rel="stylesheet" href="includes/reset.css">
<link rel="stylesheet" href="includes/jquery.mobile-1.4.2.min.css">
<link rel="stylesheet" href="includes/style.css">
<script src="http://ift.tt/ZnjyAz"></script>
<script src="includes/jquery.mobile-1.4.2.min.js"></script>
<script src="js/jquery.slides.min.js"></script>

<!-- SlidesJS Required (if responsive): Sets the page width to the device width. -->
<meta name="viewport" content="width=device-width">
<!-- End SlidesJS Required -->

<!-- CSS for slidesjs.com example -->
<link rel="stylesheet" href="css/example.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<!-- End CSS for slidesjs.com example -->

<!-- SlidesJS Optional: If you'd like to use this design -->
<style>
body {
-webkit-font-smoothing: antialiased;
font: normal 15px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #232525;
padding-top:70px;
}

#slides {
display: none
}

#slides .slidesjs-navigation {
margin-top:3px;
}

#slides .slidesjs-previous {
margin-right: 5px;
float: left;
}

#slides .slidesjs-next {
margin-right: 5px;
float: left;
}

.slidesjs-pagination {
margin: 6px 0 0;
float: right;
list-style: none;
}

.slidesjs-pagination li {
float: left;
margin: 0 1px;
}

.slidesjs-pagination li a {
display: block;
width: 13px;
height: 0;
padding-top: 13px;
background-image: url(img/pagination.png);
background-position: 0 0;
float: left;
overflow: hidden;
}

.slidesjs-pagination li a.active,
.slidesjs-pagination li a:hover.active {
background-position: 0 -13px
}

.slidesjs-pagination li a:hover {
background-position: 0 -26px
}

#slides a:link,
#slides a:visited {
color: #333
}

#slides a:hover,
#slides a:active {
color: #9e2020
}

.navbar {
overflow: hidden
}
</style>
<!-- End SlidesJS Optional-->

<!-- SlidesJS Required: These styles are required if you'd like a responsive slideshow -->
<style>
#slides {
display: none
}

.container {
margin: 0 auto
}

/* For tablets & smart phones */
@media (max-width: 767px) {
body {
padding-left: 20px;
padding-right: 20px;
}
.container {
width: auto
}
}

/* For smartphones */
@media (max-width: 480px) {
.container {
width: auto
}
}

/* For smaller displays like laptops */
@media (min-width: 768px) and (max-width: 979px) {
.container {
width: 724px
}
}

/* For larger displays */
@media (min-width: 1200px) {
.container {
width: 1170px
}
}
</style>
<!-- SlidesJS Required: -->
<script>
$(function() {
$('#slides').slidesjs({
width: 940,
height: 528,
navigation: false
});
});
</script>
</head>
<body>

<section data-role="page" id="hp">
<header data-role="header">My First App</header>
<article role="main" class="ui-content">
<h1>Welcome Aboard</h1>
<p>First Sectionn</p>




<a href="#about">about</a>
</article>
<footer data-role="footer">credits</footer>
</section>


<section data-role="page" id="about">
<header data-role="header">About My First App</header>
<article role="main" class="ui-content">
<h1>Who are we</h1>
<p>Second Sectionn</p>

<div class="container">
<div id="slides">
<img src="img/example-slide-1.jpg" alt="Photo by: Missy S Link: http://ift.tt/1prNHL6">
<img src="img/example-slide-2.jpg" alt="Photo by: Daniel Parks Link: http://ift.tt/1prNJ5z">
<img src="img/example-slide-3.jpg" alt="Photo by: Mike Ranweiler Link: http://ift.tt/1mQFgFV">
<img src="img/example-slide-4.jpg" alt="Photo by: Stuart SeegerLink: http://ift.tt/1prNHLc">
<a href="#" class="slidesjs-previous slidesjs-navigation"><i class="icon-chevron-left icon-large"></i></a>
<a href="#" class="slidesjs-next slidesjs-navigation"><i class="icon-chevron-right icon-large"></i></a>
</div>
</div>
<a href="#hp">home page</a>
</article>
<footer data-role="footer">credits</footer>
</section>


</body>
</html>


asked 37 secs ago






Aucun commentaire:

Enregistrer un commentaire