-5

我的小提琴

        $szPostContent = $post->post_content;
        $szSearchPattern = '#(<img.*?>)#';
        $a='';
        $aPics='';
        preg_match_all( $szSearchPattern, $szPostContent, $aPics );
        $iNumberOfPics = count($aPics);
        echo "<br />Number of pics on each post...............".$iNumberOfPics;
        array_push($postimg, $iNumberOfPics);

$iNumberofPics 显示来自单个帖子的图像...查看演示 ..u 会发现在箭头 img 鼠标悬停时滑块消失。而我想连续显示主 div 直到用户留在该页面上..

4

2 回答 2

1
<div class='container' style='height:150px; width:225px;'>
    <div class="imageslider" id="imageslider" style="border: 1px solid #000000; height:150px; width:225px;display:none">
        <img class="arrow left" style="border: 1px solid #000000; height:25px; width:25px; float:left; margin-top:50px;" />
        <div class="images"></div>
        <img class="arrow right" style="border: 1px solid #000000; height:25px; width:25px; float:right; margin-top:50px;" />
    </div>

和脚本

$(".container").hover(function () {
    $(this).find('.imageslider').show();
}, function () {
    $(this).find('.imageslider').hide();
});

小提琴

.container是否有一个占位符,以便您能够将鼠标悬停

于 2013-05-27T10:56:22.417 回答
1

我不确定我的问题是否正确,所以我希望这些方法之一对您有所帮助:在您的代码中,您使用 onmouseout,而不是 onmouseover。你可以:

  • 在 mouseover 和 mouseout 上使用 $(...).show() 和 $(...).hide()。
  • 看看 $(...).toggle() 会带走一些工作。
于 2013-05-27T10:14:27.233 回答