Jump to content

Menu + changing text

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Dorgon

Dorgon

    Newbie

  • Members
  • PipPip
  • 24 posts
Good day everyone,

I am working on a website with a class mate.
At the homepage we would like to have a "intro text", it should be looking like this:

----------------------------------------------
Totaly free.......|..Explaining box (variable text |
E-mail service...|........................................|
.....................|.........................................|
----------------------------------------------

So on the left it should have a "menu", and when you click on "totaly free" there should be an explaining text in the box on the right, so the text in the explaining box should change when you click on a other text in the "menu"like e-mail service.

Is there any way to do this?
Thanks in advance.

William.

#2
Mark Wylde

Mark Wylde

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
I would look into using jQuery to do this. If you include jQuery into your website you can use code like this:



<script>

$().ready( function() {

  $('#linkTest').hover ( function() { 

      $('#linkDescription').html('This takes you to the test page');

  });


  $('#linkTest2').hover ( function() { 

      $('#linkDescription').html('This takes you to the second test page');

  });

});


</script>


<a href='test.htm' id='linkTest'>Test Link</a>

<a href='test2.htm' id='linkTest2'>Test Link 2</a>


<div id='linkDescription'></div>



I have no idea if the above will work as I wrote it quickly, but that sort of thing should work.

#3
Dorgon

Dorgon

    Newbie

  • Members
  • PipPip
  • 24 posts
hey,

Thanks fot the reply, but actualy I found where I was looking for.

Something like this:

Dynamically Loaded Articles




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users