Jump to content
php.lv forumi

iedabūt js var iekšs php


anonīms

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...