admin管理员组文章数量:1405757
I'm developing a full-screen web app for an iPad that will have a series of images on screen in a slider whereby the user will be able to scroll between them and then click on one.
Here is an example image of how it would look:
There are plenty of jQuery-based sliders out-there but all require the use of a user clicking some form of button. What I want to do is replicate it so that the user would swipe the screen to move between the different images.
Here is some example markup:
<ul id="magazine-slider">
<li>
<div class="image">
<img src="magazine-cover-jan.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>January 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
<li>
<div class="image">
<img src="magazine-cover-feb.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>February 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
<li>
<div class="image">
<img src="magazine-cover-mar.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>March 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
</ul>
<ul id="magazine-slider-pagination">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
Can anyone help? Thanks
I'm developing a full-screen web app for an iPad that will have a series of images on screen in a slider whereby the user will be able to scroll between them and then click on one.
Here is an example image of how it would look:
There are plenty of jQuery-based sliders out-there but all require the use of a user clicking some form of button. What I want to do is replicate it so that the user would swipe the screen to move between the different images.
Here is some example markup:
<ul id="magazine-slider">
<li>
<div class="image">
<img src="magazine-cover-jan.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>January 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
<li>
<div class="image">
<img src="magazine-cover-feb.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>February 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
<li>
<div class="image">
<img src="magazine-cover-mar.png" width="640" height="640" />
</div>
<div class="meta">
<h3>Magazine Title</h3>
<h4>March 2010</h4>
</div>
<ul class="options">
<li><a title="Delete" href="#">Delete</a></li>
<li><a title="View" href="#">View</a></li>
</ul>
</li>
</ul>
<ul id="magazine-slider-pagination">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
Can anyone help? Thanks
Share asked Feb 4, 2011 at 17:54 CameronCameron 28.9k102 gold badges289 silver badges490 bronze badges2 Answers
Reset to default 2You have to intercept touchStart/Move/End events ( http://developer.apple./library/safari/#documentation/appleapplications/reference/SafariWebContent/HandlingEvents/HandlingEvents.html )... take a look here:
http://padilicious./code/touchevents/
and here for a pre-built ponent:
iPhone / iPad / iPod swipe events javascript
You will probably need a touch-based mobile framework to handle the touches/swipe.
One that es to mind is Sencha.
本文标签: javascriptiPad WebApp that simulates swipe sliderStack Overflow
版权声明:本文标题:javascript - iPad WebApp that simulates swipe slider - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744883571a2630352.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论