Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML Query

Reply
Thread Tools

HTML Query

 
 
Tim Greer
Guest
Posts: n/a
 
      01-03-2009
Ramon wrote:

> Hi,
>
> Does someone here knows if there exists a tag that can fold/hide
> text... and when the user clicks it, the text will become visible.
>
> Thanks


CSS is good for this sort of thing, as is JavaScript, or something like
Flash, depending on the technology you want to use. CSS might be the
most compatible with the most browsers.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      01-03-2009
In article <(E-Mail Removed)>,
Bergamot <(E-Mail Removed)> wrote:

> icky-poo!


This expression is a little too babyish for grown ups around here."Yuk"
might just get over the line for adults. "Bloody hell!" (and stronger as
far as I am concerned) and "Geez" are also perfectly acceptable to most
people. Some others, perhaps more Australian in nature, would be ok too:
"Don't make me puke, mate" and "**** poor, mate".

--
dorayme
 
Reply With Quote
 
 
 
 
Jani
Guest
Posts: n/a
 
      01-03-2009
On 3 Jan., 12:40, Ramon <(E-Mail Removed)> wrote:
> Hi,
>
> Does someone here knows if there exists a tag that can fold/hide text...
> and when the user clicks it, the text will become visible.
>
> Thanks


What about event listeners?
Also javascript but you can sit long time to get a nice hotspot or
image-map matrix:
a mouse over here - some text there. But only for a more grafical
realization. Like the buttons of a mobile phone.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-03-2009
Jani wrote:

> What about event listeners?


Event listeners *is* JavaScript, not HTML. HTML cannot *do* anything, it
is not a programming language, it is markup only, HyperText Markup
Language...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Chaddy2222
Guest
Posts: n/a
 
      01-04-2009
On Jan 4, 1:55*pm, Ed Mullen <(E-Mail Removed)> wrote:
> Ramon wrote:
> > Thanks Ed for your tips. *It worked great!

>
> > Ed Mullen wrote:
> >> Ramon wrote:
> >>> Hi,

>
> >>> Does someone here knows if there exists a tag that can fold/hide
> >>> text... and when the user clicks it, the text will become visible.

>
> >>> Thanks

>
> >> You need javascript but there are lots of existing examples:

>
> >>http://markehansen.07x.net/FAQ.htm

>
> >>http://www.tjkdesign.com/articles/toggle_elements.asp

>
> >> Google text toggle for more.

>
> HTH. *Just remember that you need to also account for the minority of
> browsers who visit and have javascript turned off.
>

What, like Googlebot for example!
--
Regards Chad. http://freewebdesignonline.org
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      01-04-2009
On 03 Jan 2009, Els <(E-Mail Removed)> wrote:

> Neredbojias wrote:
>> On 03 Jan 2009, Ramon <(E-Mail Removed)> wrote:
>>
>>> Does someone here knows if there exists a tag that can fold/hide
>>> text... and when the user clicks it, the text will become visible.

>>
>> How would the user be able to click it when it's invisible?

>
> nitpick!


I used to be a nice guy but dorayme burned out all my gentler
sensibilities.

--
Neredbojias
http://www.neredbojias.org/
http://www.neredbojias.net/
The road to Heaven is paved with bad intentions.
 
Reply With Quote
 
houghi
Guest
Posts: n/a
 
      01-04-2009
Chaddy2222 wrote:
>> HTH. *Just remember that you need to also account for the minority of
>> browsers who visit and have javascript turned off.
>>

> What, like Googlebot for example!


No, firefox, Internet Explorer, Opera and others where people have
decided to turn off javascript.

houghi
--
This was written under the influence of the following:
| Artist : Henny Vrienten
| Song : Kom in de zon
| Album : Mijn Hart Slaapt Nooit
 
Reply With Quote
 
Jani
Guest
Posts: n/a
 
      01-04-2009
On 3 Jan., 23:19, "Jonathan N. Little" <(E-Mail Removed)> wrote:

> Event listeners *is* JavaScript, not HTML. HTML cannot *do* anything, it
> is not a programming language, it is markup only, HyperText Markup
> Language...


But the browser can do it for you [1]
And you can add a little JavaScript. [2] The W3C also handle a little
bit with events.

[1]

<style type="text/css">
<!--
a:link {
color: #FFFFFF;
text-decoration:none;
}
a:visited {
color: #FFFFFF;
}
a:active {
color: #FF0000;
}
..green { color: #00CC00 }
-->
</style>
</head>

<body>
<a href=""><span style="color:black">[+] Hello! Me I am the first
line.</span>
<br />
<br />
<span class="green">Here</span> is some more text.<br />
Here <span class="green">is</span> some more text.<br />
Here is <span class="green">some</span> more text.<br />
Here is some <span class="green">more</span> text.<br />
Here is some more <span class="green">text.</span><br /> </a>
</body>




[2]

<body>


<script type="text/javascript">
<!--
document.writeln('<table cellspacing="0" cellpadding="0">');
for(i=0 ; i<20 ; i++)
{
document.writeln('<tr>');
for(j=0 ; j<20 ; j++)
{

k = i*20 + j + 2*i;
l = k + 1;
m = k + 2;
n = k - 1;
o = k - 2;

p = k - 22;
q = k - 44;
r = k + 22;
s = k + 44;

document.writeln('<td><img src="yellow.gif" id="' + k + '"
onMouseOver="document.getElementById(\'' + l + '\').src=\'blue.gif\',

document.getElementById(\'' + m + '\').src=\'blue.gif\',
document.getElementById(\'' + n + '\').src=\'blue.gif\',
document.getElementById(\'' + o +

'\').src=\'blue.gif\', document.getElementById(\'' + p + '\').src=
\'blue.gif\', document.getElementById(\'' + q + '\').src=\'blue.gif
\',

document.getElementById(\'' + r + '\').src=\'blue.gif\',
document.getElementById(\'' + s + '\').src=\'blue.gif\'"
onMouseOut="document.getElementById(\'' + l

+ '\').src=\'yellow.gif\', document.getElementById(\'' + m + '\').src=
\'yellow.gif\', document.getElementById(\'' + n + '\').src=\'yellow.gif
\',

document.getElementById(\'' + o + '\').src=\'yellow.gif\',
document.getElementById(\'' + p + '\').src=\'yellow.gif\',
document.getElementById(\'' + q +

'\').src=\'yellow.gif\', document.getElementById(\'' + r + '\').src=
\'yellow.gif\', document.getElementById(\'' + s + '\').src=\'yellow.gif
\'"></td>');

}
document.writeln('</tr>');
}
document.writeln('</table>');
//-->
</script>

</body>


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-04-2009
Jani wrote:
> On 3 Jan., 23:19, "Jonathan N. Little" <(E-Mail Removed)> wrote:
>
>> Event listeners *is* JavaScript, not HTML. HTML cannot *do* anything, it
>> is not a programming language, it is markup only, HyperText Markup
>> Language...

>
> But the browser can do it for you [1]
> And you can add a little JavaScript. [2] The W3C also handle a little
> bit with events.
>


Okay, I will try to explain this to you. JavaScript is not HTML. Already
mentioned in thread this cannot be done with HTML but would need
JavaScript. The problem is JavaScript is optional, so the usual caveats
apply. The functionality of the page *must* preserved if JavaScript is
not enabled. So the page should be in a fully readable state when
JavaScript is not present.

> [1]
>
> <style type="text/css">
> <!--

^^^^^^
Stop putting HTML within STYLE elements. They are *not* required as so
many erroneously believe.

> a:link {
> color: #FFFFFF;
> text-decoration:none;
> }
> a:visited {
> color: #FFFFFF;
> }
> a:active {
> color: #FF0000;
> }
> .green { color: #00CC00 }
> -->
> </style>
> </head>
>
> <body>
> <a href=""><span style="color:black">[+] Hello! Me I am the first

^
Having an empty HREF is not a good idea, can have unwanted side effects.
Far better to attach an onclick handler directly to the element, in your
example it would be the SPAN, however I would think DIV of would be
more appropriate.

> line.</span>
> <br />
> <br />
> <span class="green">Here</span> is some more text.<br />
> Here <span class="green">is</span> some more text.<br />
> Here is <span class="green">some</span> more text.<br />
> Here is some <span class="green">more</span> text.<br />
> Here is some more <span class="green">text.</span><br /> </a>

^^^^
Hmm using XHTML? In most cases, this is a very bad idea which has been
discussed ad nauseam. If you using strict then your "document.writeln"
statements are a *no-no!* JavaScript is optional, functionality of the
page *must* preserved if JavaScript is not enabled.


> </body>
>
>
>
>
> [2]
>
> <body>
>
>
> <script type="text/javascript">
> <!--
> document.writeln('<table cellspacing="0" cellpadding="0">');


"document.writeln" are usually a bad idea, and in your application,
absolutely a bad idea. Why? Because if the client has JavaScript
disabled he will see *nothing*. Remember above?

<snip code>

If I where to recommend a way to do this here is the parameters that I
would say are appropriate.

1. Create the full *static* page with all elements in the visible and
readable state. This includes this initial state defined in the CSS,
remember CSS is optional too!

2. Put all your JavaScript in an *external* file.

3. Related to #2, do not pepper your markup with handler attributes,
i.e., all those "onclick=" but instead attach the handlers with your
functions in your JavaScript. Of course MS's contrariness means code forks!

function someClickHandler(){
...
}

function initClickHandler(targetID){
var target=documentGetElementBtId(targetID);
if(target){
if(target.addEventListener){ //modern browsers
target.addEventListener('click', someClickHandler, false);
}
else if(target.attachEvent){ //Old MS IE support
target.attachEvent('onclick', someClickHandler);
}
else {
//ain't supported so do nothing
}
}
}

// function to call all your event handler inits
function attachMyEvents(){
initClickHandler();
// any other init functions add to list
...
}

//now set to page loads to set it all up
// attach event after page loads
if( window.addEventListener ) {
window.addEventListener('load',attachMyEvents,fals e); //legacy DOM
} else if( document.addEventListener ) {
document.addEventListener('load',attachMyEvents,fa lse); //proper DOM
} else if( window.attachEvent ) {
window.attachEvent('onload', attachMyEvents); //Damn IE only
}



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-04-2009
Jonathan N. Little wrote:
> Jani wrote:
>> On 3 Jan., 23:19, "Jonathan N. Little" <(E-Mail Removed)> wrote:


>>
>> <style type="text/css">
>> <!--

> ^^^^^^
> Stop putting HTML within STYLE elements. They are *not* required as so


Correction: Stop putting HTML *comments* within STYLE elements.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET won't retrieve query results that depend on union query Eric Nelson ASP .Net 5 02-04-2009 10:51 PM
Trying to query the Address table data of AdventureWorks database from Query Analyzer - need help! Learner ASP .Net 1 01-30-2006 08:58 PM
Build dynamic sql query for JSTL <sql:query> Anonymous Java 0 10-13-2005 10:01 PM
xpath query query David Gordon XML 2 05-18-2005 03:33 PM
CAML Query: Multiple Query Fields Issue Jon F. ASP .Net Web Services 0 05-12-2004 08:19 PM



Advertisments