5, September 2008

Showing/hiding DIVs - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: Showing/hiding DIVs
« previous next »
Pages: [1] Print

Author Topic: Showing/hiding DIVs  (Read 1849 times)
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« on: Jul 15, 2006, 12:13:27 AM »

Here is a strange problem I have with IE (arghhh)

My intention is to create a hidden div, and then call a function which will show/hide this div.

Here is the code I use :

Code:
<div id="search" style="display:none;">
bla bla bla bla
</div>

<script type="text/javascript"><!--
function wd_search()
{
var srchD = document.getElementById("search");
if ( srchD.style.display == "" ){
  srchD.style.display = "none";
  srchD.style.visibility = "hidden";
}else
{
  srchD.style.display = "";
  srchD.style.visibility = "visible";
}
return true;
}
// --></script>

The problem is that it works fine with Firefox, but IE doesn't do anything, and doesn't display an error either.

Can you  please help me with this?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #1 on: Jul 15, 2006, 01:03:30 AM »

I finally short it out.

Code:
                function wd_search()
{
if ( document.getElementById("WDsearch").style.display == "" ){
  document.getElementById("WDsearch").style.display = "none";
}
else
{
  document.getElementById("WDsearch").style.display = "";
}
return ;
}

BTW check the new search functionallity Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 15, 2006, 01:41:19 AM »



BTW check the new search functionallity Smiley

search is not working Sad

I have some similar code:
Code:
function show_layer(element) {
document.getElementById(element).style.visibility = 'visible';
}
function hide_layer(element) {
document.getElementById(element).style.visibility = 'hidden';
}


Last blog : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #3 on: Jul 15, 2006, 01:42:10 AM »

What browser are you using?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Jul 15, 2006, 01:42:58 AM »

What browser are you using?
firefox, maybe some cache problem?


Last blog : Is your website is down? Know before your visitors do!
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jul 15, 2006, 01:44:00 AM »

now it works but there is something strange because the first time I have to click twice.


Last blog : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #6 on: Jul 15, 2006, 01:45:01 AM »

Propably  it was from the caching or something.

I see the site with Firefox too.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jul 15, 2006, 01:45:07 AM »

forgot it everything is fine with the search box...


Last blog : Is your website is down? Know before your visitors do!
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Jul 15, 2006, 01:45:45 AM »

do you think the google site search will show the user all results?


Last blog : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #9 on: Jul 15, 2006, 01:47:44 AM »

Cool. Thanks for the feedback Wink

Quote
do you think the google site search will show the user all results?

The site is indexed very well, and I switched to google search because SMF's search feauture is very bad, and of course it is not working with the rest of the site (tutorials,directory,tags)

I will leave it this way untill some day I have enough time to rewrite the SMF's search system....

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Jul 15, 2006, 01:50:26 AM »

the google search is OK and you earn some money if people click the ads Wink


Last blog : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #11 on: Jul 15, 2006, 01:54:55 AM »

the google search is OK and you earn some money if people click the ads Wink

Yes and from my experience with my other sites, it has good CTRs Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
WebDigity Gangsta
***
Gender: Male
Posts: 105
18 credits
Members referred : 0



« Reply #12 on: Jul 23, 2006, 10:51:53 AM »

Wow thats smooth Smiley
I might try something like that with ads. BTW if i open the search bar then close the browser does it remember that it was opened?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #13 on: Jul 23, 2006, 01:11:08 PM »

Wow thats smooth Smiley
 I might try something like that with ads. BTW if i open the search bar then close the browser does it remember that it was opened?

No it doesn't, but this could be easilly be done with a cookie.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3289
Tags : google internet explorer firefox cookies browsers Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: Showing/hiding DIVs
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 06:15:44 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.293
Total Topics: 7.476
Total Members: 3.899
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: speedy5044

30 Guests, 4 Users online :

13 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.