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

          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

          Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

          How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page