可以独立显示/隐藏.如何隐藏在秀场上? [英] Can independently show/hide. How do I hide on show?

查看:116
本文介绍了可以独立显示/隐藏.如何隐藏在秀场上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经对此攻击了两个星期.

I have been attacking this for two weeks.

我找到了一种切换显示/隐藏的方法.但是每个图像都位于下一个图像的顶部,因此,如果未关闭打开的图像,则其他切换的图像也不会显示,因为它们位于该图像的下方.

I have found a way to toggle the show/hide. But each image is over the top of the next, so if the open image isn't closed, no other toggled image will show because they are underneath it.

这是基本的js:

<script type="text/javascript">
animatedcollapse.ontoggle=function($, divobj, state){ 
}
animatedcollapse.init()
</script>

<script type="text/javascript">
animatedcollapse.addDiv('profile','hide=1')
animatedcollapse.addDiv('photo','hide=1')
animatedcollapse.addDiv('sabout','hide=1')
animatedcollapse.addDiv('copy','hide=1')
animatedcollapse.init()
</script>

它在这里的用法如下:

<div align="center">
    <a href="javascript:animatedcollapse.toggle('profile')" title="Profile" border="0">< img src="img here.png" srcover="img here" srcdown="img here" height="50px" width="96px"></a>
</div></div>

<div id="mask">

    <div id="profile" class="nah">
        <a name="profile"></a>
        <div class="contentp">
        <div align="center">
        <div class="close"><div align="right"><a id="aclose" href="javascript:animatedcollapse.toggle('profile')" title="Close"><span>CLOSE ME</span></a></div></div>

            < img src="img here" border="0">

        </div></div>
    </div>

将其乘以页数". 页面"是div中的另一张图像,该图像被调用,滑入到要查看的位置,并在单击关闭"时被收起.我想摆脱关闭按钮,只是当切换另一个div时隐藏当前的div.这可能吗?

Multiply that by the number of "pages". A "page" is another image inside a div that is called, slides down into place to be viewed, and is put away when close is clicked. I want to get rid of the close button and just have the current div hide when another div is toggled. Is this possible?

要全面了解它,这是我个人经历的开始: http://www.lantiis.com ..我真的只想要一个漂亮的简单微型站点,该站点可以流动并且对于极端的初学者来说很容易导航.现在,即使是中级用户也对关闭"按钮感到困惑,并且显然不知道单击该按钮(因此,他们只能看到PROFILE的第一张图片)...

To get the full feel of it, here is the start of my personal hell: http://www.lantiis.com .. I really just want a nice simple mini-site that flows and is easy to navigate for the extreme beginner. Right now, even intermediate users are confused by the close button and apparently don't know to click it (so they only ever see the first image for PROFILE) ...

感谢所有帮助和潜在客户. 兰蒂斯

All help and leads are appreciated. Lantiis

推荐答案

我注意到您在自己的网站上包括了jQuery(并且已经对其进行了标记),因此我将建议一个jQuery解决方案.只是为了详细说明zod的反应.

I noticed that you're including jQuery (and you have tagged it) on your site, so I'll suggest a jQuery solution. Just to elaborate a bit more on zod's response.

$(document).ready(function () {
  $('#idOfYourMenuItem').click(function () {
    //Hide the other images
    hideAll();

    //Show the image that you want
    $('#divOfTheRelatedImage').show();
  }
  //Bind your other menu items here
  //$('#idOfYourMenuItem2').click  etc...

  hideAll();

  //Show your first page here somewhere
  $('#divOfFirstPage').show();
});

function hideAll() {
  $('#divOfTheRelatedImage').hide();
  $('#divOfTheRelatedImage2').hide();
}

这是一种非常简单的方法,应该可以帮助您入门.如果您需要更多帮助,请告诉我.

This is a very simple approach and should help you get started. If you need more help let me know.

这篇关于可以独立显示/隐藏.如何隐藏在秀场上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆