homepage Welcome to WebmasterWorld Guest from 54.161.185.244
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Changing contents of div or paragraph with a link in CSS
JakeFrederick

10+ Year Member



 
Msg#: 69 posted 4:37 pm on Dec 13, 2001 (gmt 0)

How can I change the contents of a div or paragraph when the user presses a link using CSS? I am trying to create an image gallery where the user presses a thumbnail and the full image displays. I don't want to use pop-up windows and I don't want to refresh the screen or use frames. Can this be done easily?

 

joshie76

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 69 posted 5:55 pm on Dec 13, 2001 (gmt 0)

Try this little sample, uses the innerHTML property. Won't work in NN4 but will in pretty much everything else.

<html>
<head>
<title>Untitled</title>
<script>

function updateTestParagraph(string)
{
document.getElementById('test').innerHTML = string
}

var testString = "Look, DHTML wonder eh?"
</script>
</head>

<body>
<a href="javascript:updateTestParagraph(testString);" >click here</a>
<p id="test"></p>

</body>
</html>


rcjordan

WebmasterWorld Senior Member rcjordan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 69 posted 6:29 pm on Dec 13, 2001 (gmt 0)

DHTML can add an SSI-type injection into a div. Here's the best one I've found to date, it works on NS4, NS6, & IE4 up.

[dhtmlnirvana.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved