SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Storing cookies..

    Hey..

    I'm a complete and utter beginner when it comes to javascript.. :P
    I found this code on your forums..

    Code:
    function MinMax(id,n,x){
     obj=document.getElementById(id);
     if (obj.offsetHeight<x){
      obj.style.height=x+'px';
     }
     else {
      obj.style.height=n+'px';
     }
    }
    Which I'm going to use on a particualr part of my site.. to maximize and minimize a div..

    My question is, how can I store cookie, so if a member minimizes something, and comes back an hour later the div is still minimized?

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm well I wasn't exactly sure how to implement a cookie into the code..

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you read any of those tutorials? Doing that and learning how to write cookies will help you out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •