Note that there are some explanatory texts on larger screens.

plurals
  1. POChange div id on click of a button?
    primarykey
    data
    text
    <p>Right now I'm working to create a website that can showcase multiple images on the homepage, that can cycle by the click of a button. Almost like a gallery but more geared towards page previews. What I am trying to figure out is how to change a div's id/class when a button is clicked.</p> <p>I have looked at a few other questions, but none that show this happening for 4 different ids.</p> <p>I am very new to JavaScript, and am trying to figure it out to best suit my situation.</p> <p>Here is the jsFiddle that I have made for my page. The goal is to have the buttons at the top change the green div <code>#Filler</code> to a new id/class on click.</p> <p><a href="http://jsfiddle.net/xCGDT/1/" rel="nofollow">http://jsfiddle.net/xCGDT/1/</a></p> <pre><code>#Filler { margin: auto; max-height: 700px; width: 1400px; background-color: green; max-width: 1366px; height: 800px; z-index: 1; margin-top: -250px; overflow: inherit; background-image: url(nature5.jpg); animation: Filler 1s 1; -webkit-animation: Filler 1s 1; transition-timing-function: ease; -webkit-transition-timing-function: ease; opacity:1; } </code></pre> <p>changed to</p> <pre><code>#Filler2 { margin: auto; max-height: 700px; width: 1400px; background-color: red; max-width: 1366px; height: 800px; z-index: 1; margin-top: -250px; overflow: inherit; animation: Filler 1s 1; -webkit-animation: Filler 1s 1; transition-timing-function: ease; -webkit-transition-timing-function: ease; opacity:1; } </code></pre> <p>Like I said I'm very new to this, and this is for a WebDesign class project.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload