jQuery Scrollable下一个/上一个按钮无法包含在其他标签中

时间:2010-02-28 22:43:10

标签: jquery button tags scroll jquery-scrollable

我可以滚动到这里:http://treethink.treethink.net/portfolio/

我试图在2个标签周围加上ap标签,这些标签会导致滚动条来回移动,但无论我在标签周围放置什么,它都会打破滚动(span,div,p ...... “不行”

我该如何解决这个问题?我认为这与滚动中涉及的jQuery有关。

以下是该部分页面的代码:

<div id="wrapper">

<div id="portfolio">

<div id="portfolio-main">

<div id="scroll">

<div class="scrollable">

<div id="thumbs">

<?php
   $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID);

   $i = 1;
   foreach( $pages as $page ) {
       $content = $page->post_title;
       if( empty($content) ) continue;

       $content = apply_filters('the_content', $content);

       ?>

<div class="column" style="background: url(/wp-content/uploads/<?php echo $page->post_name ?>.jpg);">
<div class="desc"><a href="<?php echo get_page_link($page->ID) ?>"><h2><?php echo $page->post_title ?></h2></a><p><?php if(get_post_meta($page->ID, "date", true)) { echo get_post_meta($page->ID, "date", true); ?><br /><?php } ?><?php echo get_post_meta($page->ID, "desc", true); ?></p></div></div>

<?php $i++;

   }    ?>

</div>

</div>

<a class="prev banner-button">prev</a>

<a class="next banner-button">next</a>

</div>

<br clear="all" />

<script>

$(function() {      

    $("div.scrollable").scrollable({
        size: 4,
        items: '#thumbs',  
        hoverClass: 'hover'
    }); 

});
</script>

</div>

</div>

</div>

以下是我试图将其包装的样式:

#main-buttons{
    height: 30px;
    width: 560px;
    top: 460px;
    right: 0;
    position: absolute;
    z-index: 1;
    text-align: right;
}

最后,这里是包含可滚动内容的jQuery文件:http://treethink.treethink.net/wp-content/themes/treethink/scroll/jquery.tools.min.js

谢谢, 涉

1 个答案:

答案 0 :(得分:0)

试试这个:

<div id='prevnext'>
    <a class="next portfolio-button">next</a>
    <a class="prev portfolio-button">prev</a>
 </div>

和此:

<script type="text/javascript">
$(function() {
    $("div.scrollable").scrollable({
        size: 4,
        items: '#thumbs',
        hoverClass: 'hover',
        next: "#prevnext .next",
        prev: "#prevnext .prev"
        });

    });
</script>
希望这有帮助。