9, February 2012

Showing/hiding DIVs - webmaster forum

 
Webdigity webmaster forums
[ 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
Instabuck - The easy way to sell digital products online

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



« on: Jul 14, 2006, 11:13:27 pm »

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 or twitter

Last blog : Butterfly Marketing 2.0
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5776
46253 credits
Members referred : 3



« Reply #1 on: Jul 15, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 15, 2006, 12: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 : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5776
46253 credits
Members referred : 3



« Reply #3 on: Jul 15, 2006, 12:42:10 am »

What browser are you using?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Jul 15, 2006, 12:42:58 am »

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


Last blog : A new Wordpress theme for our blog
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jul 15, 2006, 12:44:00 am »

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


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5776
46253 credits
Members referred : 3



« Reply #6 on: Jul 15, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Jul 15, 2006, 12:45:07 am »

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


Last blog : A new Wordpress theme for our blog
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Jul 15, 2006, 12:45:45 am »

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


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5776
46253 credits
Members referred : 3



« Reply #9 on: Jul 15, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Jul 15, 2006, 12:50:26 am »

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


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5776
46253 credits
Members referred : 3



« Reply #11 on: Jul 15, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
Spy Agent
***
Gender: Male
Posts: 113
70 credits
Members referred : 0


« Reply #12 on: Jul 23, 2006, 09: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: 5776
46253 credits
Members referred : 3



« Reply #13 on: Jul 23, 2006, 12: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 or twitter

Last blog : Butterfly Marketing 2.0
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....

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?
Feb 09, 2012, 07:47:53 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!






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