Note that there are some explanatory texts on larger screens.

plurals
  1. PORadio toggle button upgrading functionality
    primarykey
    data
    text
    <p>Problem: I want a three way toggle on my radio buttons.</p> <p>Example: all gray to start, first click on button 1 changes it to green, second click on the SAME button 1, changes it to peach, any following click will cycle between these two states. A click on any other button will reset this back to the original state.</p> <p>I have Three Radio type Toggle button. Only one button can select a time like the radio. Also If any selected button is clicked again it will unchecked. I am trying to add something more in this. </p> <p>I am wanting something like this:</p> <p>Initially the buttons are gray.</p> <p>If any button is clicked, the button turns into gray from green. Again clicking that selected button turns back to gray. </p> <p><strong>But</strong> what I am wanting initially all buttons will stay Gray but If I click any one first It will turn into green color and again click the same button will give another color (can be any color). again clicking same button will back to green and will go on.. But IF I clicked to another button previous button will Change to Gray and Current button can Do the same .</p> <p>This was requirement for one of my College project. But Finding no way for making like this.</p> <p>Should be Made with keeping current functionalities. Hope I am clear about the requirements. If this can be done it would be Great for me.</p> <p>here is the link for current Example: <a href="http://jsfiddle.net/saifrahu28/eQ744/7/" rel="nofollow"><strong>JS Fiddle</strong></a></p> <p><strong>HTML:</strong></p> <pre><code>&lt;div style="margin:0px auto; margin-top:100px; width:960px;"&gt; &lt;a href="#"&gt; &lt;span class="toggleButtonRadio normal"&gt;toggle Radio button&lt;/span&gt; &lt;/a&gt; &lt;a href="#"&gt; &lt;span class="toggleButtonRadio normal"&gt;toggle Radio button&lt;/span&gt; &lt;/a&gt; &lt;a href="#"&gt; &lt;span class="toggleButtonRadio normal"&gt;toggle Radio button&lt;/span&gt; &lt;/a&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>* { margin: 0; padding: 0; border: 0px; } body { background: #fafafa; font-family: Helvetica, Arial, sans-serif; font-size: 0.813em; color:#333333; } a {color:#737373;text-decoration:none; } a:link { text-decoration: none;outline: none; } a:visited {text-decoration: none; } a:hover {color:#454545; } a:active {text-decoration: none; } ul {list-style: none; text-decoration: none; } ol {list-style-position: inside; color:#333333;padding:12px 10px 25px 15px;font-size: 1.07em;} ol, li {padding-bottom:8px;} img {} em {color: #737373; font-weight:300;} h1 {color: #737378; margin:20px 5px 20px 0px; font-size:2.4em; text-transform:uppercase;letter-spacing:1px; font-weight:100; text-shadow:1px 1px 1px #fff; } h2 {color: #454545; margin:10px 5px 0px 0px;} h3 {color: #454545; margin:10px 5px 0px 0px;} h4 {color: #454545; margin:10px 5px 20px 0px; font-size:1.2em; width:98%; border-bottom:1px solid #eee;padding-bottom:10px;} h5 {color: #454545; margin:10px 5px 0px 0px;} h6 {color: #454545; margin:10px 5px 0px 0px;} p { color:#333; font-size:1.154em; margin:5px 10px 10px 0px; padding-bottom:10px;line-height:140%;} hr { border: 0; clear: both; display: block; width: 100%; background-color: #bbbbbb; height: 1px; margin: 5px 0px; } select { color: #454545; } .toggleButtonRadio , .toggleButton { background: #e1e1e1; text-decoration: none; text-align: center; font-family: Helvetica, Arial, sans-serif; font-size: .769em; font-weight: 900; color: #454545; text-transform: uppercase; text-decoration: none; padding: 5px 10px; -webkit-border-radius: 15px; border-radius: 15px; -webkit-box-shadow: 0px 0px 3px 0px rgba(64, 64, 64, .5); box-shadow: 0px 0px 3px 0px rgba(64, 64, 64, .5); } .toggleButtonRadio:hover, .toggleButton:hover{ background:#d4d4d4; } .toggleButtonRadio.active , .toggleButton.active{ background:#90bf00; color:#fff; } .active:hover{ background:#7ca600; } .active2{ background:#fcc79a; } </code></pre> <p><strong>JS</strong></p> <pre><code>$('.toggleButtonRadio').click(function(){ $('.toggleButtonRadio').not(this).removeClass("active"); $(this).toggleClass("active"); }); </code></pre>
    singulars
    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.
 

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