قرار دادن toggleclass در سلکت ها
سوال
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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
<!doctype html> <html> <head> <style> @charset "utf-8"; /* CSS Document */ body { margin: 0; font-family: Arial, Helvetica, sans-serif; } . html, body * { box-sizing: border-box; font-family: 'Open Sans', sans-serif; } .framform{ width: 95%; height: 40%; background-color: #2B2B2B; box-sizing: content-box; margin: auto; margin-top: 30px; box-shadow: 0px 2px 7px rgba(0,0,0,0.2); overflow: hidden; transition: all .5s ease; color: white; } .titrform{ text-align: center; color: #FFFFFF; font-size: 24px; margin-top: 20px; } @media screen and (max-width: 600px) { .titrform{font-size: 16px} } .formlist{ float: right; padding-right: 15px; font-size: 20px; margin-top: 10px; width: 50%; text-align: right } .inputlist{ float: right; width: 50%; height: 50px; background-color: #333333; opacity: 70%; margin-bottom: 10px; margin-top: 0px; margin-right: 15px; box-shadow: none; border-bottom: none; border-right: none; border-top: none; border-left: none; border-radius: 5px; display: block; } .inputlist1{ float: left; color: #363636; opacity: 40%; border-radius: 20px; margin-bottom: 10px; margin-right: 15px; margin-left:10px; width: 50%; } .formlist1{ float: left; padding-right: 10px; font-size: 20px; } .btn-animate { float: left; font-weight: 700; text-transform: uppercase; font-size: 13px; text-align: center; color: rgba(255,255,255, 1); padding-top: 8px; width: 100%; height: 35px; border: none; border-radius: 20px; margin-top: 23px; background-color: rgba(16,89,255, 1); left: 0px; top: 0px; transition: all .5s ease, top .5s ease .5s, height .5s ease .5s, background-color .5s ease .75s; } .btn-animate-grow { width: 130%; height: 625px; position: relative; left: -55px; top: -420px; color: rgba(255,255,255,0); background-color: rgba(255,255,255,1); } .framform select{ text-align: center; font-size: 28px; width: 10%; font-style: bold; color: white; direction: rtl; } .formlistselect{ float: right; font-size: 20px; width: 50%; height: 50%; display: inline; padding-left: 1px; } .inputgenre{ width: 20%; background-color: #333333; border: none; } .tableinput{ width: 100%; direction: rtl; text-align: center; float: right; margin-right: 15px; font-size: 20px } .tableinput td{ margin-right: 50px; color: #333333; } .hiphop-nav{ display: block; } } </style> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <title>Untitled Document</title> </head> <html> <body style="background-color: #282828"> <div class="titrform">دریافت آثار ارسالی شما</div> <div class="container-fluid"> <div class="framform"> <div class="formlist"> <label>*نام شما</label> </div> <input class="inputlist" type="text"></input> <div class="formlist"> <label class="formlist">*نام اثر</label> </div> <input class="inputlist" type="text"></input> <div class="formlistselect"> <table class="tableinput "> <script> $(document).ready(function() { $(".hiphop-btn").click(function() { $("option.hiphop-btn").addClass('hiphop-nav-active'); }); }); });</script> <tr> <th>تمپو</th> <th>گام آهنگ</th> <th>ژانر</th> <th>ساب ژانر</th> </tr> <tr> <td><select class="inputgenre" style="width: 100%;height: 100%;"> <option class="inputgenreoption">هیچکدام</option> <option >0-50</option> <option >50-100</option> <option >100-150</option> <option >150-200</option> </select></td> <td> <select class="inputgenre" style="width: 100%"> <option>c</option> </select> </td> <td> <select class="inputgenre" style="width: 100%"> <option class="hiphop-btn">هیپ هاپ</option> <option class="pop-btn">پاپ</option> <option>آر اند بی</option> <option>راک</option> <option>کلاسیک</option> <option>الکترونیک</option> <option>لوفای</option> <option>سینماتیک</option> <option>جاز</option> </select> </td> <td> <select class="inputgenre" style="width: 100%"> <option class=>هیچکدام</option> <option class="hiphop-nav">ترپ</option> <option class="hiphop-nav">اولد اسکول</option> <option class="hiphop-nav">نیو اسکول</option> <option class="pop-nav">الکترونیک</option> <option class="pop-nav">هیپ هاپ</option> <option class="pop-nav">کلاسیک</option> </select> </td> </tr> </table> </div> </div> </body> </html> |
سلام من میخوام با استفاده از toggleclass یا addclass فرقی نمیکه
دوتا سلکت داشته باشم طبق کدی که قرار دادم
مثلا روی هیپ هاپ کلیک کردم بیاد به من ترپ و اولد اسکول رو نمایش بده
دقیقا باید چه کد جاوایی بنویسم؟
اگر براتون مقدور هست کمکم کنید
0
انجمن برنامه نویسان جاوا
2 سال
0 پاسخ ها
115 دیده شده
0
ارسال یک پاسخ
شما برای افزودن نظر جدید یا باید وارد شوید یا اینکه ثبت نام کنید. ورود ثبت نام