Home.php
And this is the .js
The "Accordion" script is not hidden. I cant click it.
Any idea? Or you need more source files
Thanks!
PHP:
<?php
require("config.php");
$ide = new IDE;
try { $ide->loadInjections("home"); }catch(Exception $e) { error($e->getMessage());}
echo "<h2>Latest News</h2>";
foreach($news['news'] as $value) {
echo "<div class='views-row views-row-1 views-row-odd views-row-first'>
<div class='article'>
<h3 class='article_title'>
<a href='#'>".$value['title']."</a>
<span class='article_detail'>
Posted on <span class='date'>".UNIX_TimeStamp($value['time'])."</span>
</span>
</h3>
<div class='article_body'>
<p>".$value['body']."</p>
<div class='article_controls'>
<ul class='links inline'>
<li class='node_read_more first last'>
<a href='".WEBSITE."/index.php/home/view/".$value['id']."'>View comments</a></li>
</ul></div>
</div>
</div> </div>";
}
echo "<div class='readArchive'><br><a href='".WEBSITE."/index.php/home/archive'>Go to archive posts</a></div>";
?>
And this is the .js
PHP:
$(function () {
// Configure News
$('.views-row').not(':first-child').each(function () {
$(this).find('.article').addClass('body_hidden');
var x = 1;
});
$('.views-row .article a').click(function () {
var article = $(this).parents('.article');
if (article.hasClass('body_hidden')) {
$('.views-row .article').not('.body_hidden').addClass('body_hidden');
article.removeClass('body_hidden');
return false;
}
});
// $('#block-views-news-block_1 .article').click(function () {
// $('#block-views-news-block_1 .article').not('.body_hidden').addClass('body_hidden');
// $(this).removeClass('body_hidden');
// });
});
The "Accordion" script is not hidden. I cant click it.
Any idea? Or you need more source files
Thanks!