aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes swap content picture/text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "swap content picture/text" Watch "swap content picture/text" New topic
Author

swap content picture/text

Cheikh Sow
Greenhorn

Joined: May 23, 2005
Posts: 11
My problem is that I have a content that has a pretty big picture in it when the page loads, but What I want is when I click on the menu the pic disappears and be replaced by the content of whatever is clicked.
working link at www.sadibu.net/aj.php
note: Only Cephus Gregg Jr has content and when click it will display on the right of the pic
Also only Home should display the pic

As CSS this is a bit of what I have

Never written a piece of javasript how can I do one that will do what I want

Thank you
#content {
/* float then create left and top margin of content */
float: both;
margin-left: 280px;
margin-top: 0 ;
}

#content img {
float: left;
margin: 0;
padding: 2px;
border: 1px solid #FF0000;
}
<body>
<div id="content">
<img src="images/JamalHis_big.jpg" alt=""
width="630" height="953">
</body>
[ August 24, 2006: Message edited by: Cheikh Sow ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Are you after a classic framed site? That is what it seems like by the example.

Eric
Cheikh Sow
Greenhorn

Joined: May 23, 2005
Posts: 11
No I am not using frame All my layout is based on CSS
basically i have a header footer left navigation and the content on the right.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I basically am saying, why don;t you use frames since that is what you are after.

Or since you are using php on the server and adding the new content, why donl;t you put the content into a div and display it.

I do not see how CSS is involoved in this when you are using the server to replace content. I am confused more than you are.

You want the picture to disappear. So remove it. Do not show it.

Eric
Cheikh Sow
Greenhorn

Joined: May 23, 2005
Posts: 11
Let me clarify I want the picture to disappear only under one condition and that is when home is not clicked. Also the pic is displayed inside the content, and since I have only on content I need to be able to alternate from pic to text. And why do you want me to use html frame when you know more than I that it sucks, and basically what I have so far is a frame as you notice. Can javascript do what I want if so how?
[ August 24, 2006: Message edited by: Cheikh Sow ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

To make things appear and disappear, toggle the CSS display attribute between none and block.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swap content picture/text
 
Similar Threads
Images on Images using CSS
wide navigation bar causes problems
center a div inside a div
Problem hiding div within div
converting html to pdf