FBJS/FBML:单击单选按钮时显示文本框

发布于 2024-08-23 04:09:14 字数 107 浏览 6 评论 0原文

我想使用 FBML 作为画布,并希望在单击单选按钮时显示一个文本框。 有人可以帮我解决这个问题吗?例如,如果用户选择其他作为选项,则应该显示一个文本框。是否可以?如何?我很想从回复者那里了解更多信息。

I want to use FBML as a canvas and would like to display a textbox on click of radio button.
Can anybody out there help me out on this? e.g. if a user selects other as option it should make appear a text box. Is it possible? how? I'm eager to learn more from the responder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑咖 2024-08-30 04:09:15

我也只是在寻找这个问题的答案。
我发现这里有用的链接

我想我可以分享它。
我已经尝试和测试过,动画只是让它看起来更光滑:)

function showdiv(id){
        var elm = document.getElementById(id);
        if(elm.getStyle('display') == 'block'){
            Animation(elm).to('height', '0px').to('opacity', 0).hide().ease(Animation.ease.end).go(); 
            return false;
        }else{
            Animation(elm).to('height', 'auto').to('opacity', 1).show().ease(Animation.ease.end).go(); 
            return false;
        }
    }

<div id="about" style="display: none"> 
Facebook is a social utility that connects people with friends and others who work, study and live around them. 
People use Facebook to keep up with friends, upload an unlimited number of photos, share links and videos, and 
learn more about the people they meet. 
</div> 
<a href="#" onclick="showdiv('about');">Show Content</a>.

i was just looking for the answer for this question as well.
and i found a useful link here.

thought i might share it.
i've tried and tested, the animation just makes it look slicker :)

function showdiv(id){
        var elm = document.getElementById(id);
        if(elm.getStyle('display') == 'block'){
            Animation(elm).to('height', '0px').to('opacity', 0).hide().ease(Animation.ease.end).go(); 
            return false;
        }else{
            Animation(elm).to('height', 'auto').to('opacity', 1).show().ease(Animation.ease.end).go(); 
            return false;
        }
    }

<div id="about" style="display: none"> 
Facebook is a social utility that connects people with friends and others who work, study and live around them. 
People use Facebook to keep up with friends, upload an unlimited number of photos, share links and videos, and 
learn more about the people they meet. 
</div> 
<a href="#" onclick="showdiv('about');">Show Content</a>.
阪姬 2024-08-30 04:09:14

是的,这是可能的。
第 1 步:创建一个 div 并将文本框代码放入该 div 中,然后将任何 id 分配给该 div 让我们说 id =“textbox”。并在 div 的 style 属性中放置 display='none' 并在单选输入的 onclick 上调用以下函数

function showBoxt(id)
  {
      obj=document.getElementById(id);
            if(obj.getStyle('display')=='none')
             {
                    obj.setStyle({display:'block'});
             }
            else
              {
                obj.setStyle({display:'none'});
              }
    }

yes it is possible .
Step 1 : make a div and put text box code into that div , and assign any id to the div let say id ="textbox". and in style attribute to the div put display='none' and call below function on onclick of the radio input

function showBoxt(id)
  {
      obj=document.getElementById(id);
            if(obj.getStyle('display')=='none')
             {
                    obj.setStyle({display:'block'});
             }
            else
              {
                obj.setStyle({display:'none'});
              }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文