用explorer显示/隐藏问题7 [英] show/hide problem with explorer 7

查看:60
本文介绍了用explorer显示/隐藏问题7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我一直试图在我的网站上使用显示/隐藏脚本但是当我点击隐藏时;按钮出现错误与资源管理器7.

网站开始下降=)并且页面顶部发生空白

。当我使用代码多于一个

内容时出现问题,当我使用下面的代码添加新内容时,空白

越来越大=)


*我在joomla上建立了自己的网站。开源内容管理

软件。


< b>我在头标记之间尝试的代码是< / b>


< script type =?text / javascript?>

function shToggle(content){

if(document.getElementById(content).style .display ==?none?)

document.getElementById(content).style.display =?block?

else

document.getElementById (内容).style.display =?none?

}

< / script>

< b>我用过那个在我的每个内容< / b>


< span>卡尔加里NHL团队的名字是什么?< / span>

< a href =?javascript :void(0);?的onclick = shToggle?(卡尔加里?);返回

false;?>显示/隐藏答案< / a>


< div id =?calgary? style =?display:none;?> The Calgary Flames< / div>


您可以在这里查看网站图片:
http://forum.joomla.org/viewtopic.php?f=32& t = 341625 我还在joomla论坛上发布了问题,但我认为这是关于编码的。

Hi all,

I have been trying to use a show / hide script on my web site but when
I click on the "hide" button there occurs an error with explorer 7.
The web site starts to go down =) and there happens a blank on the top
of the page. the problem occurs when I use the codes more than one
content and when I add new contents with the codes below, the blanks
is getting greater =)

* I built my web sites on "joomla" open source content management
software.

<b>The codes I have tried between head tags are </b>

<script type=?text/javascript?>
function shToggle(content) {
if (document.getElementById(content).style.display == ?none?)
document.getElementById(content).style.display = ?block?
else
document.getElementById(content).style.display = ?none?
}
</script>
<b>and I used that one in my each content </b>

<span>What?s the name of Calgary?s NHL Team?</span>
<a href=?javascript:void(0);? onclick=?shToggle(?calgary?); return
false;?>show/hide answer</a>

<div id=?calgary? style=?display:none;?>The Calgary Flames</div>

You can check the images of the web site here :
http://forum.joomla.org/viewtopic.php?f=32&t=341625 I have also post
the problem on joomla forum but I think it''s about coding.

推荐答案

Le 11/8/08 7:23 AM,可能是一个écrit:
Le 11/8/08 7:23 AM, may bailey a écrit :

*我在joomla上建立了我的网站开源内容管理

软件。
* I built my web sites on "joomla" open source content management
software.



此代码中没有任何东西可以调用joomla。

Nothing in this code calls something about joomla.


< script type =?text / javascript ?>

函数shToggle(内容){

if(document.getElementById(content).style.display ==?none?)

document.getElementById(content).style.display =?block?

else

document.getElementById(content).style.display =?none?

}

< / script>
<script type=?text/javascript?>
function shToggle(content) {
if (document.getElementById(content).style.display == ?none?)
document.getElementById(content).style.display = ?block?
else
document.getElementById(content).style.display = ?none?
}
</script>



function shToggle(content){

var d = document.getElementById(content).style;

d.display = d.display ==''none''? ''block'':''none'';

返回false;

}

function shToggle(content) {
var d = document.getElementById(content).style;
d.display = d.display==''none''? ''block'' : ''none'';
return false;
}


< span>卡尔加里NHL团队的名字是什么?< / span>

< a href =?javascript :void(0);?的onclick = shToggle?(卡尔加里?);返回

false;?>显示/隐藏答案< / a>
<span>What?s the name of Calgary?s NHL Team?</span>
<a href=?javascript:void(0);? onclick=?shToggle(?calgary?); return
false;?>show/hide answer</a>



注意使用正确的报价:和''而不是?和?


< p>< a href ="#" onclick =" return shToggle(''calgary'');"> show / hide

answer< / a>< / p>

take care to use correct quotes : " and '' instead of ? and ?

<p><a href="#" onclick="return shToggle(''calgary'');">show/hide
answer</a></p>


< div id =?calgary? style =?display:none;?> The Calgary Flames< / div>
<div id=?calgary? style=?display:none;?>The Calgary Flames</div>



< p id =" calgary" style =" display:none"> voir ou non< / p>


-

sm

<p id="calgary" style="display:none">voir ou non</p>

--
sm


Le 11/8/08 10:40 AM,SAMaécrit:
Le 11/8/08 10:40 AM, SAM a écrit :

Le 11/8/08 7:23 AM,may bailey a écrit:


注意使用正确的引号:"和''而不是?和?
Le 11/8/08 7:23 AM, may bailey a écrit :

take care to use correct quotes : " and '' instead of ? and ?




CSS:

=====


#quizz span {display:none; }

#quizz .answer span {display:inline;颜色:红色}


JS:

====

功能切换(什么){

what.className = what.className ==''''? ''回答''''''';

}


HTML:

======

< h3> quizz< / h3>

< ul id =" quizz" title ="点击显示或隐藏答案>

< li onclick =" toogle(this);">

问题#1:< ; span>回答1< / span>< / li>

< li onclick =" toogle(this);">

问题#2: < span>回答2< / span>< / li>

< li onclick =" toogle(this);">

问题#3 :< span>回答3< / span>< / li>

< / ul>

-

sm



CSS :
=====

#quizz span { display: none; }
#quizz .answer span { display: inline; color: red }

JS :
====
function toggle(what) {
what.className = what.className==''''? ''answer'' : '''';
}

HTML :
======
<h3>quizz</h3>
<ul id="quizz" title="click to show or hide answer">
<li onclick="toogle(this);">
question #1 : <span>answer 1</span></li>
<li onclick="toogle(this);">
question #2 : <span>answer 2</span></li>
<li onclick="toogle(this);">
question #3 : <span>answer 3</span></li>
</ul>
--
sm


嗨再次,


感谢您的帮助,但它没有解决问题。


我的代码带有你的新代码,但我得到了相同的错误=(顺便说一下

你希望我照顾的标记()在我的网站上似乎没问题。


顺便说一句,joomla与我写的代码没什么关系。

我只想提供关于我的问题的足够信息。


您的代码中有一个问号< scri pt> ...,那是什么

for?


问候
Hi again,

Thanks for your help but it didnt solve the problem.

I my codes with your new codes but I got the same error =( By the way
the marks (") that you wanted me to take care of seems ok in my site.

By the way, there is nothing related to joomla with the codes I wrote.
I just wanted to give enough informations about my problem.

There was a question mark in your codes for <script>..., what was that
for?

regards


这篇关于用explorer显示/隐藏问题7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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