在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:reusserdesign/ExpressionEngine-Ajax-Pagination开源软件地址:https://github.com/reusserdesign/ExpressionEngine-Ajax-Pagination开源编程语言:JavaScript 100.0%开源软件介绍:PagerDescriptionPager is a jQuery plugin to make Ajax pagination + history in ExpressionEngine a little easier (and nicer looking!). DemoSorry, it's not a live demo, but the demo video should help you see what's going on here. How to useExample ExpressionEngine markup:<section id="articles">
{exp:channel:entries channel="news" limit="10" paginate="bottom" dynamic="no"}
<article>
<h2>{title}</h2>
{content}
</article>
{paginate}
{pagination_links}
<ul class="pagination">
{previous_page}
<li><a href="{pagination_url}">«</a></li>
{/previous_page}
{page}
<li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
{/page}
{next_page}
<li><a href="{pagination_url}">»</a></li>
{/next_page}
</ul>
{/pagination_links}
{/paginate}
{/exp:channel:entries}
</section> Add Pager Javascript (don't forget jQuery!) to document<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="hashchange.js"></script>
<script src="pager.js"></script>
<script src="index.js"></script> Dan Eden)Add Pager CSS for the kewl loading animation (all CSS-based, thanks to<link href="pager.css" rel="stylesheet"> Celebrate!OptionsThe plugin comes with a nice set of options you can dabble with. link: '.pagination a', // The anchor to your pagination links
pull: '#articles > *', // When your Ajax request occurs, the plugin pulls this DOM element out into the article wrapper
loaderID: 'loader', // The ID of the loader element displayed when the Ajax request is initiated
scrollTo: 'body', // Where the window scrolls after the next page successfully loads
fadeSpeed: 100, // The fade speed on the loader animation and opacity changes for the article wrapper
fadeOpacity: .5 // The opacity level on the article wrapper when the Ajax request is initiated NotesThis has only really been tested with our standard ExpressionEngine pagination methods. Meaning, this may or may not work when using this with Wordpress or content management systems. Fork it and make it better! My jQuery skills are pretty n00bish. CreditsAgain, I'm a jQuery n00b. Much of this code was integrated, dissected, and taught to me via Design Aeon. The tutorial was very well documented, and it helped me further my jQuery knowledge for this. A massive shoutout to the hashchange plugin for the Ajax history support. Also, huge kudos to Dan Eden for his awesome CSS-based loader. You can thank him that "retina", "gif", and "extra http request" are no longer scary words. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论