Answer the question
In order to leave comments, you need to log in
How to make one tab open by default in Ajax?
Hello!
Tell me how to make one tab open by default on ajax?
I have the following code to switch tabs:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript">
$(document).ready(function(){
$('.url_1').click(function(){
var url=$('.url_1').attr('href');
$('#content').load(url);
});
});
$(document).ready(function(){
$('.url_2').click(function(){
var url=$('.url_2').attr('href');
$('#content').load(url);
});
});
$(document).ready(function(){
$('.url_3').click(function(){
var url=$('.url_3').attr('href');
$('#content').load(url);
});
});
$(document).ready(function(){
$('.url_4').click(function(){
var url=$('.url_4').attr('href');
$('#content').load(url);
});
});
</script>
<a type="button" href="/1/11.php" class="url_1 btn btn-ft active" onclick="return false;">Первый</a>
<a type="button" href="/1/22.php" class="url_2 btn btn-ft" onclick="return false;">Второй</a>
<a type="button" href="/1/33.php" class="url_3 btn btn-ft" onclick="return false;">Третий</a>
<a type="button" href="/1/44.php" class="url_4 btn btn-ft" onclick="return false;">Четвр</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question