Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Using JavaScript or CSS to replace text


  • Please log in to reply

#1
interpolarity

interpolarity

    Member

  • Member
  • PipPipPip
  • 286 posts
I want to have a blank div that can have text put in by clicking on a link, or, if the div has text in it, for the link to replace the text....
so like...


link
link1
link2

(click the first link)

ABCD

link
link1
link2

(click the second link)

EFGH

link
link1
link2

etc....

any ideas?
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Play with the attached files and see if they will work as you want.

Ron
  • 0

#3
interpolarity

interpolarity

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 286 posts
VERY close to what I'm looking for, but is it possible for the links to send the text somewhere other than right in front of it...

let me explain exactly what I want....

I want to have a page on my website with poetry. Instead of having tons of poems show up, I want them to be able to click a link, and have the poem appear in a specific box (like a div tag or something) that will have a specified width and can scroll. When they click one poem, I want the poem to appear. When they click on another, I want the former to go away, and the new one to appear....I hope I'm coming across clear...
  • 0

#4
Supercalifragilistic

Supercalifragilistic

    Member

  • Member
  • PipPipPip
  • 404 posts
iframes?
  • 0

#5
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
OK. That can be done by JavaScript too. IFrames is one solution, too, to load by iframe's target name into the <div> by clicking different links with that name. JS would not work by anyone who has it turned off in their browser. Your choice.

Ron
  • 0

#6
interpolarity

interpolarity

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 286 posts
I found what I was looking for...thank you for your help...

I found it here-->http://www.netlobo.com/div_hiding.html
  • 0

#7
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
That's good, but same limitations as it uses JS. Of course, my attachments had some basic CSS, but I didn't set it up with divs that much. Also, have one with a div that shows the text on a mouseover. At least, I don't have to write anymore code for you. LOL.

Ron

Edited by Major Payne, 20 August 2007 - 04:13 PM.

  • 0

#8
interpolarity

interpolarity

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 286 posts
Thank you very much for your help....u see, I am programming-challenged....

here is a working example though...
http://musichasm.110...ery/Poetry.html
  • 0

#9
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Nice. I remember this site of yours from other post(s) you've made on GTG. LOL

Ron
  • 0






Similar Topics

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP