1

我在这里有一个可滚动的:http: //treethink.treethink.net/portfolio/

我试图在 2 a 标签周围放置 ap 标签,这会导致可滚动来回移动,但无论我在 a 标签周围放置什么,它都会破坏滚动(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

谢谢,韦德

4

1 回答 1

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>

希望这有帮助。

于 2010-03-01T07:02:24.427 回答