How to display three post photo div at the bottom of the page using Reactjs and Css2019 Community Moderator ElectionReactJS: How to hide/unhide images inside toggled list itemsHow do I get a div to float to the bottom of its container?How can I position my div at the bottom of its container?How to align content of a div to the bottom?How do you easily horizontally center a <div> using CSS?CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the pageHow to align a <div> to the middle (horizontally/width) of the pageDojo TabContainer with styling in Internet ExplorerHTML href with css ie Problemcss - position div to bottom of containing divToggling CSS property off and on changes apperance
What would be the most expensive material to an intergalactic society?
Getting the || sign while using Kurier
Has a sovereign Communist government ever run, and conceded loss, on a fair election?
I reported the illegal activity of my boss to his boss. My boss found out. Now I am being punished. What should I do?
How do spaceships determine each other's mass in space?
Street obstacles in New Zealand
Why do phishing e-mails use faked e-mail addresses instead of the real one?
Professor forcing me to attend a conference, I can't afford even with 50% funding
What do *foreign films* mean for an American?
Which situations would cause a company to ground or recall a aircraft series?
When Schnorr signatures are part of Bitcoin will it be possible validate each block with only one signature validation?
Is it safe to abruptly remove Arduino power?
Which classes are needed to have access to every spell in the PHB?
What can I do if someone tampers with my SSH public key?
How can I get players to focus on the story aspect of D&D?
Why does Central Limit Theorem break down in my simulation?
Is it possible that a question has only two answers?
What ability score modifier does a javelin's damage use?
Haman going to the second feast dirty
What do you call someone who likes to pick fights?
Help find my computational error for logarithms
In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?
Outlet with 3 sets of wires
PTIJ: Why does only a Shor Tam ask at the Seder, and not a Shor Mu'ad?
How to display three post photo div at the bottom of the page using Reactjs and Css
2019 Community Moderator ElectionReactJS: How to hide/unhide images inside toggled list itemsHow do I get a div to float to the bottom of its container?How can I position my div at the bottom of its container?How to align content of a div to the bottom?How do you easily horizontally center a <div> using CSS?CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the pageHow to align a <div> to the middle (horizontally/width) of the pageDojo TabContainer with styling in Internet ExplorerHTML href with css ie Problemcss - position div to bottom of containing divToggling CSS property off and on changes apperance
The code below has three posts photos in the array. When I click on each post button am supposed to be seeing
Three post Photo div that corresponds to each post all at the bottom.
My Problem:
My issue is that it is showing just one post photo div which keeps replacing others after I added the CSS code below.
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
screenshot showing jammed div based on the CSS implementation
What I want:
I need to be seeing three div post photos if the three toggle button is clicked
Here is the main code
import React, Component, Fragment from "react";
import render from "react-dom";
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
class Focus extends React.Component
constructor(props)
super(props);
this.state =
data: [],
shown: true,
;
componentDidMount()
this.setState(
data: [
id: "1", title: "my first title", image: "http://localhost/apidb_react/1.png", visible: true , photoVisible: true,
id: "2", title: "my second title", image: "http://localhost/apidb_react/2.png", visible: true, photoVisible: true,
id: "3", title: "my third title", image: "http://localhost/apidb_react/3.png", visible: true, photoVisible: true
]
);
toggle(id)
const newData = this.state.data.map(item =>
if(item.id === id)
return ...item, visible: !item.visible;
return item;
)
this.setState(
data: newData
);
/*
hideUnhidePhoto(id)
const newData = this.state.data.map(item =>
alert(id);
if(item.id === id)
alert('ttto ' +item.id);
return ...item, photoVisible: !item.photoVisible;
return item;
)
this.setState(
data: newData
);
*/
hideUnhidePhoto(id)
this.setState(( data ) =>
return
data : data.map(item => (
...item,
photoVisible : (id == item.id) ? !item.photoVisible : item.photoVisible ))
);
render()
return (
<div>
<label>
<ul>
this.state.data.map((post, i) => (
<li key=i>
<div style=mainArea>
<div style=photodiv>
<div style= display: post.visible ? "none" : "block">
<b>Post Data:</b> post.title --post.id <br />
<span style=color: 'red' onClick= () => this.hideUnhidePhoto(post.id) > Hide/Unhide Photo</span>
<div style= display: post.photoVisible ? "block" : "none">
<img src=post.image />
</div>
</div></div>
</div>
<button onMouseDown= () => this.toggle(post.id) >Toggle </button><br />
<br />
</li>
))
</ul>
</label>
</div>
);
css reactjs
add a comment |
The code below has three posts photos in the array. When I click on each post button am supposed to be seeing
Three post Photo div that corresponds to each post all at the bottom.
My Problem:
My issue is that it is showing just one post photo div which keeps replacing others after I added the CSS code below.
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
screenshot showing jammed div based on the CSS implementation
What I want:
I need to be seeing three div post photos if the three toggle button is clicked
Here is the main code
import React, Component, Fragment from "react";
import render from "react-dom";
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
class Focus extends React.Component
constructor(props)
super(props);
this.state =
data: [],
shown: true,
;
componentDidMount()
this.setState(
data: [
id: "1", title: "my first title", image: "http://localhost/apidb_react/1.png", visible: true , photoVisible: true,
id: "2", title: "my second title", image: "http://localhost/apidb_react/2.png", visible: true, photoVisible: true,
id: "3", title: "my third title", image: "http://localhost/apidb_react/3.png", visible: true, photoVisible: true
]
);
toggle(id)
const newData = this.state.data.map(item =>
if(item.id === id)
return ...item, visible: !item.visible;
return item;
)
this.setState(
data: newData
);
/*
hideUnhidePhoto(id)
const newData = this.state.data.map(item =>
alert(id);
if(item.id === id)
alert('ttto ' +item.id);
return ...item, photoVisible: !item.photoVisible;
return item;
)
this.setState(
data: newData
);
*/
hideUnhidePhoto(id)
this.setState(( data ) =>
return
data : data.map(item => (
...item,
photoVisible : (id == item.id) ? !item.photoVisible : item.photoVisible ))
);
render()
return (
<div>
<label>
<ul>
this.state.data.map((post, i) => (
<li key=i>
<div style=mainArea>
<div style=photodiv>
<div style= display: post.visible ? "none" : "block">
<b>Post Data:</b> post.title --post.id <br />
<span style=color: 'red' onClick= () => this.hideUnhidePhoto(post.id) > Hide/Unhide Photo</span>
<div style= display: post.photoVisible ? "block" : "none">
<img src=post.image />
</div>
</div></div>
</div>
<button onMouseDown= () => this.toggle(post.id) >Toggle </button><br />
<br />
</li>
))
</ul>
</label>
</div>
);
css reactjs
add a comment |
The code below has three posts photos in the array. When I click on each post button am supposed to be seeing
Three post Photo div that corresponds to each post all at the bottom.
My Problem:
My issue is that it is showing just one post photo div which keeps replacing others after I added the CSS code below.
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
screenshot showing jammed div based on the CSS implementation
What I want:
I need to be seeing three div post photos if the three toggle button is clicked
Here is the main code
import React, Component, Fragment from "react";
import render from "react-dom";
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
class Focus extends React.Component
constructor(props)
super(props);
this.state =
data: [],
shown: true,
;
componentDidMount()
this.setState(
data: [
id: "1", title: "my first title", image: "http://localhost/apidb_react/1.png", visible: true , photoVisible: true,
id: "2", title: "my second title", image: "http://localhost/apidb_react/2.png", visible: true, photoVisible: true,
id: "3", title: "my third title", image: "http://localhost/apidb_react/3.png", visible: true, photoVisible: true
]
);
toggle(id)
const newData = this.state.data.map(item =>
if(item.id === id)
return ...item, visible: !item.visible;
return item;
)
this.setState(
data: newData
);
/*
hideUnhidePhoto(id)
const newData = this.state.data.map(item =>
alert(id);
if(item.id === id)
alert('ttto ' +item.id);
return ...item, photoVisible: !item.photoVisible;
return item;
)
this.setState(
data: newData
);
*/
hideUnhidePhoto(id)
this.setState(( data ) =>
return
data : data.map(item => (
...item,
photoVisible : (id == item.id) ? !item.photoVisible : item.photoVisible ))
);
render()
return (
<div>
<label>
<ul>
this.state.data.map((post, i) => (
<li key=i>
<div style=mainArea>
<div style=photodiv>
<div style= display: post.visible ? "none" : "block">
<b>Post Data:</b> post.title --post.id <br />
<span style=color: 'red' onClick= () => this.hideUnhidePhoto(post.id) > Hide/Unhide Photo</span>
<div style= display: post.photoVisible ? "block" : "none">
<img src=post.image />
</div>
</div></div>
</div>
<button onMouseDown= () => this.toggle(post.id) >Toggle </button><br />
<br />
</li>
))
</ul>
</label>
</div>
);
css reactjs
The code below has three posts photos in the array. When I click on each post button am supposed to be seeing
Three post Photo div that corresponds to each post all at the bottom.
My Problem:
My issue is that it is showing just one post photo div which keeps replacing others after I added the CSS code below.
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
screenshot showing jammed div based on the CSS implementation
What I want:
I need to be seeing three div post photos if the three toggle button is clicked
Here is the main code
import React, Component, Fragment from "react";
import render from "react-dom";
const mainArea=
position: 'fixed',
width: '80%',
bottom: '0%',
display: 'inline-block'
const photodiv=
position: 'relative',
width: '250px',
// height:auto,
background: 'orange',
color: 'black',
borderRadius: '5px 5px 0px 0px',
bottom: '0px',
class Focus extends React.Component
constructor(props)
super(props);
this.state =
data: [],
shown: true,
;
componentDidMount()
this.setState(
data: [
id: "1", title: "my first title", image: "http://localhost/apidb_react/1.png", visible: true , photoVisible: true,
id: "2", title: "my second title", image: "http://localhost/apidb_react/2.png", visible: true, photoVisible: true,
id: "3", title: "my third title", image: "http://localhost/apidb_react/3.png", visible: true, photoVisible: true
]
);
toggle(id)
const newData = this.state.data.map(item =>
if(item.id === id)
return ...item, visible: !item.visible;
return item;
)
this.setState(
data: newData
);
/*
hideUnhidePhoto(id)
const newData = this.state.data.map(item =>
alert(id);
if(item.id === id)
alert('ttto ' +item.id);
return ...item, photoVisible: !item.photoVisible;
return item;
)
this.setState(
data: newData
);
*/
hideUnhidePhoto(id)
this.setState(( data ) =>
return
data : data.map(item => (
...item,
photoVisible : (id == item.id) ? !item.photoVisible : item.photoVisible ))
);
render()
return (
<div>
<label>
<ul>
this.state.data.map((post, i) => (
<li key=i>
<div style=mainArea>
<div style=photodiv>
<div style= display: post.visible ? "none" : "block">
<b>Post Data:</b> post.title --post.id <br />
<span style=color: 'red' onClick= () => this.hideUnhidePhoto(post.id) > Hide/Unhide Photo</span>
<div style= display: post.photoVisible ? "block" : "none">
<img src=post.image />
</div>
</div></div>
</div>
<button onMouseDown= () => this.toggle(post.id) >Toggle </button><br />
<br />
</li>
))
</ul>
</label>
</div>
);
css reactjs
css reactjs
edited Mar 7 at 6:34
Abhishek Oza
2,13912030
2,13912030
asked Mar 7 at 5:23
Nancy MooreeNancy Mooree
4328
4328
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If I understand the issue correctly, then this can be fixed by adjusting your mainArea
style object like so:
const mainArea=
/* position: 'fixed', Remove position fixed */
width: '80%',
bottom: '0%',
display: 'inline-block'
The fixed
position basically has the effect of placing elements at a location on screen, relative to the client area of the window. This means that if you have multiple elements that share the same (default) coordinates, and are positioned with the fixed
rule, then those elements will effectively overlap one another. This gives the appearance of only one element being visible at any given time.
For a working example, see this jsFiddle:
enter link description here
Hope that helps!
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036609%2fhow-to-display-three-post-photo-div-at-the-bottom-of-the-page-using-reactjs-and%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If I understand the issue correctly, then this can be fixed by adjusting your mainArea
style object like so:
const mainArea=
/* position: 'fixed', Remove position fixed */
width: '80%',
bottom: '0%',
display: 'inline-block'
The fixed
position basically has the effect of placing elements at a location on screen, relative to the client area of the window. This means that if you have multiple elements that share the same (default) coordinates, and are positioned with the fixed
rule, then those elements will effectively overlap one another. This gives the appearance of only one element being visible at any given time.
For a working example, see this jsFiddle:
enter link description here
Hope that helps!
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
add a comment |
If I understand the issue correctly, then this can be fixed by adjusting your mainArea
style object like so:
const mainArea=
/* position: 'fixed', Remove position fixed */
width: '80%',
bottom: '0%',
display: 'inline-block'
The fixed
position basically has the effect of placing elements at a location on screen, relative to the client area of the window. This means that if you have multiple elements that share the same (default) coordinates, and are positioned with the fixed
rule, then those elements will effectively overlap one another. This gives the appearance of only one element being visible at any given time.
For a working example, see this jsFiddle:
enter link description here
Hope that helps!
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
add a comment |
If I understand the issue correctly, then this can be fixed by adjusting your mainArea
style object like so:
const mainArea=
/* position: 'fixed', Remove position fixed */
width: '80%',
bottom: '0%',
display: 'inline-block'
The fixed
position basically has the effect of placing elements at a location on screen, relative to the client area of the window. This means that if you have multiple elements that share the same (default) coordinates, and are positioned with the fixed
rule, then those elements will effectively overlap one another. This gives the appearance of only one element being visible at any given time.
For a working example, see this jsFiddle:
enter link description here
Hope that helps!
If I understand the issue correctly, then this can be fixed by adjusting your mainArea
style object like so:
const mainArea=
/* position: 'fixed', Remove position fixed */
width: '80%',
bottom: '0%',
display: 'inline-block'
The fixed
position basically has the effect of placing elements at a location on screen, relative to the client area of the window. This means that if you have multiple elements that share the same (default) coordinates, and are positioned with the fixed
rule, then those elements will effectively overlap one another. This gives the appearance of only one element being visible at any given time.
For a working example, see this jsFiddle:
enter link description here
Hope that helps!
answered Mar 7 at 9:20
Dacre DennyDacre Denny
13.1k41032
13.1k41032
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
add a comment |
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
Thanks alot Sir Dacre
– Nancy Mooree
Mar 7 at 18:20
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036609%2fhow-to-display-three-post-photo-div-at-the-bottom-of-the-page-using-reactjs-and%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown