• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP/JS/CSS Question -Accordion-

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Home.php

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.

2lt0k7c.jpg


Any idea? Or you need more source files

Thanks!
 
Back
Top