a_design_interactive
02-09-2007, 05:02 AM
hello. as one of many thousands of versions of the javascript ditty which is used to "hide" a < div > for a while, later to be revealed-- as in the case of something like this, you'll see in blogs n stuff where the "click for more" will "open" stuff under the "click for more" which was there all the time, but the CSS display is set to NONE so you can't see it until the script is activated:
this is for visual effect onl
[click here for more . . .]
blah, blah --- and blah!
the above doesn't really have javascript of course, but is for visual effect only to illustrate...
the end.
well, mine i think is "messed up".
i want to know why, if i have javascript disabled, will the browser try to take me to a directory by the SAME name of the ELEMENT ID which i used to create the special effect.
please have a look and try mine (http://clubrive.com/markview/metesties/peekatest.html). the code looks like this:
<script type="text/javascript">
<!--
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "block" ) {
el.style.display = 'block';
} else {
el.style.display = 'none';
}
}
//-->
</script>
<style type="text/css">
<!--
dd#peekaboo {
display: none;
}
-->
</style>
<!-- SNIP -->
<dl id="portlist noscripting">
<dt class="shotone">click the bold
<a onclick="switchMenu('peekaboo');" title="the Amazing Disappearing: Peek-a-Boo!">
<strong style="font-variant:small-caps;">Text We Can View All the Time</strong></a> Like Right Now Ain't it Cool</dt>
<dd class="shotone" id="peekaboo">
<h1>Peek - a - BOOOOOO!</h1></dd></dl>
please view my test page (http://clubrive.com/markview/metesties/peekatest.html)
MY QUESTION:
1.) is this "broken"? if so, what might i try to fix it?
2.) if this is NOT "broken", then what would be the typical "workaround" so if a user doesn't have javascript enabled, he or she at least won't think the web site has broken links. (i'd rather the div never display-- than the div not display AND have this broken link effect)
3.) do you have a better way of doing this? i'm totally open for improvement here as i'm 99.9% sure i didn't write this code from scratch
i know i could get away w/ leaving the code the way it is-- because most people will probably not have any problem-- will never get the "page not found" error, but inevitably, we know they're out there.
thanks for your help!!!
this is for visual effect onl
[click here for more . . .]
blah, blah --- and blah!
the above doesn't really have javascript of course, but is for visual effect only to illustrate...
the end.
well, mine i think is "messed up".
i want to know why, if i have javascript disabled, will the browser try to take me to a directory by the SAME name of the ELEMENT ID which i used to create the special effect.
please have a look and try mine (http://clubrive.com/markview/metesties/peekatest.html). the code looks like this:
<script type="text/javascript">
<!--
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "block" ) {
el.style.display = 'block';
} else {
el.style.display = 'none';
}
}
//-->
</script>
<style type="text/css">
<!--
dd#peekaboo {
display: none;
}
-->
</style>
<!-- SNIP -->
<dl id="portlist noscripting">
<dt class="shotone">click the bold
<a onclick="switchMenu('peekaboo');" title="the Amazing Disappearing: Peek-a-Boo!">
<strong style="font-variant:small-caps;">Text We Can View All the Time</strong></a> Like Right Now Ain't it Cool</dt>
<dd class="shotone" id="peekaboo">
<h1>Peek - a - BOOOOOO!</h1></dd></dl>
please view my test page (http://clubrive.com/markview/metesties/peekatest.html)
MY QUESTION:
1.) is this "broken"? if so, what might i try to fix it?
2.) if this is NOT "broken", then what would be the typical "workaround" so if a user doesn't have javascript enabled, he or she at least won't think the web site has broken links. (i'd rather the div never display-- than the div not display AND have this broken link effect)
3.) do you have a better way of doing this? i'm totally open for improvement here as i'm 99.9% sure i didn't write this code from scratch
i know i could get away w/ leaving the code the way it is-- because most people will probably not have any problem-- will never get the "page not found" error, but inevitably, we know they're out there.
thanks for your help!!!