anonīms Posted November 22, 2010 Report Share Posted November 22, 2010 ir js kods, kas tiek izmantots lapu pārlādei $(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content //document.getElementById("i1").value = activeTab; return false; }); }); un vnk funkcija, kas atvieglo visu, jo atrodas vairākās vietās. // Izvelamies serveri function izveliesServeri() { echo 'Izvēlies serveri: <select onchange="location = this.options[this.selectedIndex].value;"> <option value="services/dd2" name="i1">DUST 2 LAND</option> <option value="services/jb" name="i1">JAILBREAK</option> <option value="services/has" name="i1">HIDE AND SEEK</option> <option value="services/surf" name="i1">SURF</option> <option value="services/hns" name="i1">HNSlv</option> </select>'; return; } Jautājums ir sekojošs, kā variabli no js activeTab var dabūt iekšs option value? nepieciešams viņu iegrūst pašās beigās. Quote Link to comment Share on other sites More sharing options...
labaiss Posted November 22, 2010 Report Share Posted November 22, 2010 (edited) ajax? i don't know. Edited November 22, 2010 by labaiss Quote Link to comment Share on other sites More sharing options...
e-remit Posted November 22, 2010 Report Share Posted November 22, 2010 Tu jau nesūti to activeTab uz php, kāpēc lai viš tur parādītos? Ja tas domāts kādai nākamajai ielādei, kaut vai uzseto cookie. Quote Link to comment Share on other sites More sharing options...
indoom Posted November 23, 2010 Report Share Posted November 23, 2010 Parādi, kas ir a hrefā? Ļoti šaubos, vai to var izmantot kā selectoru jquery. var activeTab = $(this).find("a").attr("href"); $(activeTab).fadeIn(); select listam pievieno ar .append() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.