Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] slideToggle with cookies
PiotrN
post
Post #1





Grupa: Zarejestrowani
Postów: 73
Pomógł: 0
Dołączył: 8.05.2010

Ostrzeżenie: (0%)
-----


Znalazłem:
http://www.shopdev.co.uk/blog/cookies-with...psible-layouts/

Demo:
http://www.shopdev.co.uk/blog/jquery-witho...okies-demo.html

Tylko problem w tym że ja chcę aby to się rozwijało tak jak w slideToggle (jQuery) - z animacją.

Wiem że w komentarzach coś jest, ale dla mnie niezbyt jasne.

Może mi ktoś pomóc?

Chciałbym mieć ten kod jQuery slideToggle z ciasteczkami:
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $("p").hide();
  4. $("h2").click(function() {
  5. $("p").slideToggle("slow");
  6. });
  7. });
  8. </script>


Ten post edytował PiotrN 30.06.2010, 22:18:09
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
outsider
post
Post #2





Grupa: Zarejestrowani
Postów: 267
Pomógł: 36
Dołączył: 8.08.2008

Ostrzeżenie: (0%)
-----


Kod z demo z animacja:

Kod
$(document).ready(function() {
// LEFT COLUMN:
    // When the collapse button is clicked:
    $('.collapseLeft').click(function() {
        $('.collapseLeft').css("display","none");
        $('.expandLeft').css("display","block");
        $('#leftCol').animate( {height:"20px"},  {duration:400} );
    });
    // When the expand button is clicked:
    $('.expandLeft').click(function() {
        $('.expandLeft').css("display","none");
        $('.collapseLeft').css("display","block");
        $('#leftCol').animate( {height:"500px"},  {duration:500} );
    });
// RIGHT COLUMN:
    // When the collapse button is clicked:
    $('.collapseRight').click(function() {
        $('.collapseRight').css("display","none");
        $('.expandRight').css("display","block");
        $('#rightCol').animate( {height:"20px"},  {duration:400} );
    });
    // When the expand button is clicked:
    $('.expandRight').click(function() {
        $('.expandRight').css("display","none");
        $('.collapseRight').css("display","block");
        $('#rightCol').animate( {height:"500px"},  {duration:500} );
    });
});


W tym pierwszym linku masz gotowy kod z ciasteczkami, co za problem skopiowac i zmienic nazwy elemtow jesli masz inne ? Jak juz to wklej swoj kod.

Ten post edytował *OuTSideR* 1.07.2010, 10:05:59
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 13.10.2025 - 18:57