Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP