-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscripts.js
More file actions
30 lines (23 loc) · 911 Bytes
/
scripts.js
File metadata and controls
30 lines (23 loc) · 911 Bytes
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
for (var i=0; i<MicData.length; i++) {
var rowData = MicData[i];
var $template = $('<div class="HeadlineBlocks">'+
'<div class="Section">'+rowData.Section+'</div>'+
'<div class="readMore">Read More</div>'+
'<div class= "moreInfo">'+
'<div class="MainHeadline">'+rowData.MainHeadline+'</div>'+
'<div class="Excerpt">'+rowData.Excerpt+'<div>'+
'<div class="Author">'+rowData.Author+'<div>'+
'<div class="UpdatedTime">'+rowData.UpdatedTime+'<div>'+
'</div>'+
'<div>');
$template.find (".readMore").on ("click", toggleContent);
function toggleContent(e) {
$HeadlineBlocks = $(this).parent();
if ($HeadlineBlocks.hasClass("expanded")) {
$HeadlineBlocks.removeClass("expanded");
} else {
$HeadlineBlocks.addClass("expanded");
}//end of else
}//end of function
$ ('#HeadlineInfo').append($template);
}