Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: accordion for comments snews 1.71  (Read 212 times)

Tropy

  • Newbie
  • *
  • Karma: 1
  • Posts: 25
accordion for comments snews 1.71
« on: November 16, 2012, 12:06:18 AM »

Hello  guy's,

i looked at a other thread from search for accordion.

so i found some code ported it but didn't work!


her are my vision i want to work!
Code: [Select]
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

<style type="text/css">
.question { cursor: pointer ;}
</style>
</head>
<body>

<h2>Toggle Example - click to show, then click again to hide</h2>

<div id="comment">
<p id="q1" class="question">Einen Kommentar verfassen</p>
<p id="q1_answer" class="answer">
* = benötigte Eingabe

* Name:

Website URL:

* Kommentar:

* Bitte diese Zahlen addieren, um Spam vorzubeugen.:


</p>

</div>
<script>
$(document).ready(function(){
$('#comment .answer').hide();

$('#comment .question').click(function() {
var target = $(this).attr("id")
$('#' + target + '_answer').toggle();
});
<script>
$(document).ready(function(){
$('#comment .answer').hide();

$('#comment .question').click(function() {
var target = $(this).attr("id")
$('#' + target + '_answer').toggle();
});
</script>
</body>
</html>

so i have to copy the script and style things in  to template! (Okay I Know)

and the

Code: [Select]
<div id="comment">
<p id="q1" class="question"></p>
<p id="q1_answer" class="answer"></p>
in snews.php (i know too!)
betwen line 974 till 989 i think!

but didn't work!

hope anyone can help!
Logged

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: accordion for comments snews 1.71
« Reply #1 on: November 20, 2012, 01:43:45 AM »

Do you have a working version of the script or a link to the thread?

Do you mean something like this:
Code: [Select]
<!DOCTYPE html>
<html>
<head>
<style>
#toggleCommentForm {
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<div id="commentForm">
<a href="#" id="toggleCommentForm">Write Something</a>
<form method="post">
<input type="text">
<input type="submit">
</form>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$('#toggleCommentForm').on('click', function(){
$(this).next().toggle();
return false;
});
</script>
</body>
</html>
Logged

Tropy

  • Newbie
  • *
  • Karma: 1
  • Posts: 25
Re: accordion for comments snews 1.71
« Reply #2 on: November 28, 2012, 11:26:26 PM »

yes somthing like this! try it this day's.

but im not a friend off  loading things from external servers( like google)

but if it woks i'll thank you so mutch!
Logged

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: accordion for comments snews 1.71
« Reply #3 on: November 29, 2012, 12:42:49 PM »

Np. and using the Google CDN was convenient since I wouldn't know what jQuery version anyone used, if at all.
Logged