473,761 Members | 9,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

show/hide problem with explorer 7

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(conten t) {
if (document.getEl ementById(conte nt).style.displ ay == “none”)
document.getEle mentById(conten t).style.displa y = “block”
else
document.getEle mentById(conten t).style.displa y = “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=”javascrip t:void(0);” onclick=”shTogg le(’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.
Nov 8 '08 #1
17 2217
SAM
Le 11/8/08 7:23 AM, may bailey a écrit :
* I built my web sites on "joomla" open source content management
software.
Nothing in this code calls something about joomla.
<script type=”text/javascript”>
function shToggle(conten t) {
if (document.getEl ementById(conte nt).style.displ ay == “none”)
document.getEle mentById(conten t).style.displa y = “block”
else
document.getEle mentById(conten t).style.displa y = “none”
}
</script>
function shToggle(conten t) {
var d = document.getEle mentById(conten t).style;
d.display = d.display=='non e'? 'block' : 'none';
return false;
}
<span>What’s the name of Calgary’s NHL Team?</span>
<a href=”javascrip t:void(0);” onclick=”shTogg le(’calgary’); return
false;”>show/hide answer</a>
take care to use correct quotes : " and ' instead of ” and ’

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

<div id=”calgary” style=”display: none;”>The Calgary Flames</div>
<p id="calgary" style="display: none">voir ou non</p>

--
sm
Nov 8 '08 #2
SAM
Le 11/8/08 10:40 AM, SAM 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; 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
Nov 8 '08 #3
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
Nov 8 '08 #4
SAM
Le 11/8/08 11:23 AM, may bailey a écrit :
Hi again,

Thanks for your help but it didnt solve the problem.
does that here :
<http://cjoint.com/?lim1tfDaan>
work for you ?
There was a question mark in your codes for <script>..., what was that
for?
Not understood.
what about do you talk?
I did correct your function (more simple and faster)
I did correct your html link :

- href="javascrip t:void()"
is the most uggly way to code a link with a JS event
At least put : href="#"
and prefer to give an url to a page for those browsing without JS.
To stop the call to html link (href) add : return false;
in the onclick

Another example of toggle :
<http://cjoint.com/?lingA6DNtO>

Method with css rollover on links :
<http://cjoint.com/?linoIBJCOn>
(and without JS)

--
sm
Nov 8 '08 #5
On Nov 8, 4:23*am, may bailey <maybai...@gmai l.comwrote:
There was a question mark in your codes for <script>..., what was that
for?

regards
http://en.wikipedia.org/wiki/Conditional_operator
Nov 8 '08 #6
SAM
Le 11/8/08 1:18 PM, SAM a écrit :
Le 11/8/08 11:23 AM, may bailey a écrit :
>There was a question mark in your codes for <script>..., what was that
for?

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

translation :
d.display is, if d.display is 'none', 'block' else it is 'none'
same as :

d.display = (d.display=='no ne')? 'block' : 'none';

or :

if(d.display == 'none' ) d.display = 'block';
else d.display = 'none';

or :

if ( d.display == 'none' )
{
d.display = 'block';
}
else
{
d.display = 'none';
}

var displayed = d.display=='non e'; // true/false

if(displayed) d.display = 'block'; else d.display = 'none';

d.display = displayed? 'block' : 'none';
--
sm
Nov 8 '08 #7
Thanks for the detailed answers.

Unfortunately the problem is still going on for explorer 7. I would
like to give the url of the page so maybe you can understand the
reason and we can find a solution??

the url of the page : http://emlaxity.com/main/content/blogcategory/14/28/#

you will see the hide / show option by every content.

Regards
Nov 8 '08 #8
SAM
Le 11/8/08 3:09 PM, may bailey a écrit :
Thanks for the detailed answers.

Unfortunately the problem is still going on for explorer 7. I would
like to give the url of the page so maybe you can understand the
reason and we can find a solution??

the url of the page : http://emlaxity.com/main/content/blogcategory/14/28/#

you will see the hide / show option by every content.
All I can say is that works in my Fx.3 (Mac) and my IE.6 (Win XP)

I haven't IE.7

You're working in XHTML and that doc-type supports no error of coding.

Unlovely I see :

<style type="text/css">
</style>
<script type="text/javascript">
function shToggle(conten t) {
var d = document.getEle mentById(conten t).style;
d.display = d.display=='non e'? 'block' : 'none';
return false;
}

</script>

which is not in the head
And My Firefox sees 60 errors ...
What does the validator tell about this page ?
<http://validator.w3.or g/check?uri=http% 3A%2F%2Femlaxit y.com%2Fmain%2F content%2Fblogc ategory%2F14%2F 28%2F>

--
sm
Nov 8 '08 #9
SAM
Le 11/8/08 11:56 PM, SAM a écrit :
Le 11/8/08 3:09 PM, may bailey a écrit :
>>
the url of the page :
http://emlaxity.com/main/content/blogcategory/14/28/#

I haven't IE.7
I got it and did install it.

That works fine !

--
sm
Nov 8 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13589
by: Thomas Abraham | last post by:
Hi, The following code to show and hide a row works fine in netscape 7 and IE 6. But everytime the cell is hidden and displayed in netscape, it adds a new line inside the cell. Please advise. ----snip---- <html> <head> <title>Table hide</title> <script language="javascript">
3
2866
by: Sam | last post by:
I wrote a script to show or hide items in an HTML list (<ul id="stuff">) depending on whether a list-item's CLASS attribute matches an input string (catString), which is chosen from a SELECT menu. Can anyone suggest any improvements to this (below)? I'm a JS beginner. It seems to work Camino/Firefox and Mac Explorer-5, but not in Safari. I haven't been able to test it in
0
1184
by: Benny Raymond | last post by:
I just wanted to figure out a way to have a list view work like the microsoft explorer list view, so I could show/hide columns with a right click - anyone know the best way of going about this? ~Benny
7
4854
by: Larry Woods | last post by:
I don't see the pattern. I have a couple of solutions that I acquired from someone else. When I load these, I see the .vbproj and .vbproj.user files in the Solution Explorer. BUT, when I create a solution, I don't see them--even though they are in the folder, naturally. What's the trick? Thanks. Larry Woods
0
1075
by: christie.sorenson | last post by:
Hi, I have created an explorer band object using C# (with the great help of http://www.codeproject.com/csharp/dotnetbandobjects.asp ) I'm trying to make the explorer bar hide or resize to a small width for a short amount of time. However, all of the resize/hide methods I have tried only resize/hide the form that I created. So all of the data disappears from the bar, but the gray bar is still there.
5
8439
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of form tags and div elements say n. The problem
3
7936
by: Patrick Dugan | last post by:
I am using VS2005 (vb) and I have a program that starts when Windows boots up. Occasionally the icon that should appear in the system tray does not show up. The program is still running in memory but the tray icon is not there. If I start the program after Windows has booted up the icon shows every time. I am assuming that the reason is due to the icon being created before the system tray is loaded/running. I have used a timer with...
1
4173
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
1
3811
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.