Grow your CSS skills. Land your dream job.

Javascript / Cookie database With & Height problem

  • # December 24, 2012 at 9:16 am

    Hi,

    I’m currently making memo.js, a jQuery plugin for Chrome-users. With the plugin, users can mark text on a website.

    I create memo.js with cookies, Javascript, CSS and HTML.

    The script remembers the place from the memo, but not the height.
    I use **resize:both;** to change the height from the memo, with the standard height and with: 10x70px.

    Could anyone help me with the height and the width, please?
    I’m a beginning Dutch JS’er.

    Thanks!

    P.S. Here is the link to my project: [memo.js (only for Chrome)](http://www.boeddo.nl/memo.js/ “memo.js”).

    # December 24, 2012 at 9:38 am

    Didn’t you just post this discussion? http://css-tricks.com/forums/discussion/21377/javascript-cookie

    # December 24, 2012 at 11:45 am

    Yes, that’s right.
    But that was at the wrong forum (CSS)

    # December 26, 2012 at 9:39 pm

    It looks like you’re storing the top and left well enough. Perhaps you can store an object for each one:

    `{left:100,top:200,width:97,height:200}`

    As you’re able to store data already, it sounds like you’re wondering how to acquire the height and width on resize:

    jQuery('window').on('resize', '.note', function(){
    console.log(this.width());
    console.log(this.height());
    });

    Without digging too much into it, I’m sure that something along these lines will suit you.

    It would be easier to debug if we had a Codepen style example. Let me know how it goes.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".