1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
<?php $scroller = "Off"; $zero = "off"; ?> <div id="holder"> <div class="scrollerlabel"> <p><label>Button 1:</label> </div> <div class="scrollelement" onclick="change()"> <span id="onscroller" <?php if ($scroller == "On") { echo 'class="onscroller"'; } else { echo 'class="unclicked"'; } ?> >On</span><span id="offscroller" <?php if ($scroller == "Off") { echo 'class="offscroller"'; } else { echo 'class="unclicked"'; } ?> >Off</span> </div> </div> <div id="holder"> <div class="zeromonthlabel"> <p><label>Button 2:</label> </div> <div class="zeromonthelement" onclick="showzeromonthfunc()"> <span id="on" <?php if ($zero == "on") { echo 'class="on"'; } else { echo 'class="unclicked"'; } ?> >On</span><span id="off" <?php if ($zero == "off") { echo 'class="off"'; } else { echo 'class="unclicked"'; } ?> >Off</span> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $('#on, #off, #onscroller, #offscroller').click(function(){ var other = $(this).siblings().attr('id'); var current = $(this).attr('id'); if ($(this).attr('class') == 'unclicked') { $(this).removeClass('unclicked').addClass(current); $('#' + other).removeClass(other).addClass('unclicked'); } }); function change() { alert("button1"); $('#load_tweets').load('changebutton1.php'); } function showzeromonthfunc() { alert("button2"); $('#load_showzeromonth').load('changebutton2.php'); } </script> <style> p label { display: inline-block; width: 180px; } #admindeleteaccount { margin-left: 194px; margin-top: 40px; } a{text-decoration:none;} body{text-align:center;background-color:#E0E1DF;font-size:20px;color:#5a5a5a;font-weight:normal;font-family:arial;width:99%;} p{display:block;width:66px;margin:0 auto;text-align:left;} /* from main */ .scrollelement, .zeromonthelement { position: relative; display:table; width:120px; height:26px; line-height: 26px; border-radius: 5px; margin: 45px 147px; cursor:pointer; overflow: hidden; text-align: center; border: 1px solid #8BC53F; } #holder{ display: block; height: 70px; } #holder >* { display: inline-table; } #onscroller, #offscroller{ display:table-cell; font-size: 20px; font-weight: bold; } #on, #off{ display:table-cell; font-size: 20px; font-weight: bold; } .unclicked{ color: #000; background:white; } .off, .offscroller { color: #fff; background: red; } .on, .onscroller { color: #fff; background: #8bc53f; } </style> |
Latest Snippets
- Exclude category from blog while adding them to sitemap.xml 16th January 2024
- What Router can I use with Onestream Broadband? 28th June 2023
- Firefox 113 (2023) Tabs on top/bottom not working fixed again 18th May 2023
- Disable buying – Woocommerce 25th April 2023
- Windows Desktop Wallpaper Background for OCD users with shelves 13th April 2023
- Featured Image Admin Thumb – Working Plugin (WordPress 6.2) 6th April 2023
- Create a gallery in a Posts page 3rd March 2023
- Clickable elements too close together – Solved 21st February 2023
- Best ChatGPT Prompts 24th January 2023
- Make Elementor Accordion Closed by Default 13th January 2023
LINKS