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










1















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



screenshot showing jamed div based on 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>
);


















share|improve this question




























    1















    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



    screenshot showing jamed div based on 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>
    );


















    share|improve this question


























      1












      1








      1


      0






      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



      screenshot showing jamed div based on 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>
      );


















      share|improve this question
















      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



      screenshot showing jamed div based on 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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 6:34









      Abhishek Oza

      2,13912030




      2,13912030










      asked Mar 7 at 5:23









      Nancy MooreeNancy Mooree

      4328




      4328






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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!






          share|improve this answer























          • Thanks alot Sir Dacre

            – Nancy Mooree
            Mar 7 at 18:20










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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!






          share|improve this answer























          • Thanks alot Sir Dacre

            – Nancy Mooree
            Mar 7 at 18:20















          0














          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!






          share|improve this answer























          • Thanks alot Sir Dacre

            – Nancy Mooree
            Mar 7 at 18:20













          0












          0








          0







          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!






          share|improve this answer













          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!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 7 at 9:20









          Dacre DennyDacre Denny

          13.1k41032




          13.1k41032












          • 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





          Thanks alot Sir Dacre

          – Nancy Mooree
          Mar 7 at 18:20



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived