pStack DOM element stack

联合创作 · 2023-10-02 14:21

pStack plugin for jQuery.

Allows successive AJAX calls to replace contents of an element, whilst keeping previous contents in a stack.

Previous element contents can then be recalled by pop()ing them back off the stack.

Usage:

<script src="jquery.pagestack.js" type="text/javascript"></script>

<div id="myStack">
<p>this is the DOM chunk which dynamic things will happen to</p>
<p><a href="nextView.html" class="stackPush">Next ---</a></p>
</div>

<script type="text/javascript">
$('#myStack').pStack({
  aPush: 'a.stackPush',
  aPop: 'a.stackPop'
});
</script>

nextView.html might look like this (ie, not a complete HTML document):

<p>This is my new DOM contents</p>
<p><a href="#" class="stackPop">--- Prev</a></p>
浏览 4
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报