Php 使用JavaScript显示和隐藏div?
$iNumberofPics显示来自单个帖子的图像。。。Php 使用JavaScript显示和隐藏div?,php,javascript,jquery,html,Php,Javascript,Jquery,Html,$iNumberofPics显示来自单个帖子的图像。。。 查看演示..你会发现,在arrow Img的鼠标上方,滑块会消失。虽然我想继续显示主div,直到用户留在该页面上..我不确定是否正确回答了你的问题,因此我希望以下方法之一可以帮助你: 在代码中使用onmouseout,而不是onmouseover。你可以: 在mouseover和mouseout上使用$..show和$..hide。 看一下$..切换,它会减少一些工作。 .container作为占位符存在,以便您能够将其鼠标悬停@Spok
查看演示..你会发现,在arrow Img的鼠标上方,滑块会消失。虽然我想继续显示主div,直到用户留在该页面上..我不确定是否正确回答了你的问题,因此我希望以下方法之一可以帮助你: 在代码中使用onmouseout,而不是onmouseover。你可以: 在mouseover和mouseout上使用$..show和$..hide。 看一下$..切换,它会减少一些工作。
.container作为占位符存在,以便您能够将其鼠标悬停@Spokey-感谢您的回复,但我想显示imageslider div和两个箭头类,在imageslider div的鼠标悬停处,我想隐藏该imageslider div
$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);
<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();
});