Hello all,
I'm a trainee at a large enterprise in the Netherlands and i've got a project to develop a program for the company (webbased)
Now i need a function that when i click a link certain information is displayed underneath the link.
i used to know how to do this but now i need the code i've forgot how to do it, i thaught it was something with: "document.activate" or something like that.
hopefully someboddy knows it.
Regards,
Bart
jQuery provides a lot of functionality for that. You'll probably use CSS for most of this, though.
I think your better off googleing a ajax or jquery script for this.
hard to eat my burger and type but... it depends jquery does this in a couple of lines (with fades and different AWESOME effects lawl)
or you can use javascript that turns the divs display on and off (idk the browser support though, you gotta ask firefox i think he's the one who was stubborn) but jquery go for that!
http://api.jquery.com/category/effects/
I was doing something like this:
Code:<script type="text/javascript"> function showStuff(id) { document.getElementById(id).style.display = \'block\'; } function hideStuff(id) { document.getElementById(id).style.display = \'none\'; } </script>
Code:<script type="text/javascript">
function showStuff(id) {
document.getElementById(id).style.display = 'block';
}
function hideStuff(id) {
document.getElementById(id).style.display = 'none';
}
</script>
<a href="javascript:hideStuff('myDiv');">Hide</a> - <a href="javascript:showStuff('myDiv');">Show</a>
<div id="myDiv" style="display:none;">I'm here!</div>
Alright i give that a try!
Thanks in advance
That's great!
But can you also make it like,
1 click visible
second click hide, so the entire function underneath 1 hyperlink?
Code:<script type="text/javascript">
function showStuff(id) {
document.getElementById(id).style.display = 'block';
}
function hideStuff(id) {
document.getElementById(id).style.display = 'none';
}
function showhideStuff(id) {
document.getElementById(id).style.display = 'none';
var State=document.getElementById('showhide').innerHTML
if (State=='Show')
{
document.getElementById('showhide').innerHTML = 'Hide';
showStuff(id);
}
else
{
hideStuff(id)
document.getElementById('showhide').innerHTML = 'Show';
}
}
</script>
<a id='showhide' href="javascript:showhideStuff('myDiv');">Show</a>
<div id="myDiv" style="display:none;">I'm here!</div>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks