-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscores.php
61 lines (51 loc) · 1.73 KB
/
scores.php
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
<?php
//include header template
require( 'layout/header.php' );
?>
<div id="score-board" class="general-section">
<div class="container">
<div class="sport-nav tabbable">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#cricket" aria-controls="cricket" role="tab"
data-toggle="tab">Cricket</a></li>
<li role="presentation"><a href="#football" aria-controls="football" role="tab" data-toggle="tab">Football</a>
</li>
<li role="presentation"><a href="#hockey" aria-controls="hockey" role="tab" data-toggle="tab">Hockey</a>
</li>
<li role="presentation"><a href="#tennis" aria-controls="tennis" role="tab" data-toggle="tab">Tennis</a>
</li>
<li role="presentation"><a href="#vollyball" aria-controls="vollyball" role="tab" data-toggle="tab">Volly
Ball</a></li>
</ul>
<div id="ajax-score-card">
<?php require_once 'score-ajax.php'; ?>
</div>
</div>
<!-- tabbable -->
</div>
</div><!--score board end-->
<?php
//include header template
require( 'layout/footer.php' );
?>
<script>
$(document).ready(function () {
$('.sp-nav').find('#scores').addClass('active').children('a').removeAttr('href');
var score_card = $('#ajax-score-card');
var refreshScores = function() {
$.get('score-ajax.php', function(response) {
var response = $(response);
response.find('.tab-pane').each(function(){
score_card.find('#' + $(this).attr('id')).html($(this).html());
});
});
};
$('#ajax-score-card').on('click', '.sp-cta', function(e) {
e.preventDefault();
alert('hello world');
return false;
});
//window.refreshScores = refreshScores;
setInterval(refreshScores, 5000);
});
</script>