Help with jQuery font resizing script (naming the cookie)
<p>I'm using a jQuery text-resizing script, from here - <a href="http://demos.cool-javascripts.com/jquery-fontsize-controller.html" rel="nofollow">http://demos.cool-javascripts.com/jquery-fontsize-controller.html</a>. The scipt is as follows:</p>

<pre><code>function fontSize(container, target, minSize, defSize, maxSize) {
/*Editable settings*/
var minCaption = "Make font size smaller"; //title for smallFont button
var defCaption = "Make font size default"; //title for defaultFont button
var maxCaption = "Make font size larger"; //title for largefont button


//Now we'll add the font size changer interface in container
smallFontHtml = "&lt;a href='javascript:void(0);' class='smallFont' title='" + minCaption +"'&gt;" + minCaption + "&lt;/a&gt; ";
defFontHtml = "&lt;a href='javascript:void(0);' class='defaultFont' title='" + defCaption +"'&gt;" + defCaption + "&lt;/a&gt; ";
largeFontHtml = "&lt;a href='javascript:void(0);' class='largeFont' title='" + maxCaption +"'&gt;" + maxCaption + "&lt;/a&gt; ";
$(container).html(smallFontHtml + defFontHtml + largeFontHtml);

//Read cookie &amp; sets the fontsize
if ($.cookie != undefined) {
    var cookie = target.replace(/[#. ]/g,'');
    var value = $.cookie(cookie);
    if (value != null) {
        $(target).css('font-size', parseInt(value));
    } else {
        $(target).css('font-size', defSize);
    }
}

//on clicking small font button, font size is decreased by 1px
$(container + " .smallFont").click(function(){ 
    curSize = parseInt($(target).css("font-size"));
    newSize = curSize - 1;
    if (newSize &gt;= minSize) {
        $(target).css('font-size', newSize);
    } 
    if (newSize &lt;= minSize) {
        $(container + " .smallFont").addClass("sdisabled");
    }
    if (newSize &lt; maxSize) {
        $(container + " .largeFont").removeClass("ldisabled");
    }
    updatefontCookie(target, newSize); //sets the cookie 

});

//on clicking default font size button, font size is reset
$(container + " .defaultFont").click(function(){
    $(target).css('font-size', defSize);
    $(container + " .smallFont").removeClass("sdisabled");
    $(container + " .largeFont").removeClass("ldisabled");
    updatefontCookie(target, defSize);
});

//on clicking large font size button, font size is incremented by 1 to the maximum limit
$(container + " .largeFont").click(function(){
    curSize = parseInt($(target).css("font-size"));
    newSize = curSize + 1;
    if (newSize &lt;= maxSize) {
        $(target).css('font-size', newSize);
    } 
    if (newSize &gt; minSize) {
        $(container + " .smallFont").removeClass("sdisabled");
    }
    if (newSize &gt;= maxSize) {
        $(container + " .largeFont").addClass("ldisabled");
    }
    updatefontCookie(target, newSize);
});

function updatefontCookie(target, size) {
    if ($.cookie != undefined) { //If cookie plugin available, set a cookie
        var cookie = target.replace(/[#. ]/g,'');
        $.cookie(cookie, size);
    } 
}
}
</code></pre>

<p>It works fine, and in conjunction with the jQuery cookie plugin, correctly stores the desired font size in a cookie. However, the cookie is always named to whatever the 'target' is, as defined in your function call:</p>

<pre><code>function fontSize(container, target, minSize, defSize, maxSize)
function fontSize(".fontResizer", ".wrapper", 11, 13, 15);
</code></pre>

<p>So in my case, it's always called "wrapper". I can't for the life of me figure out how to specify a unique name for it.</p>

<p>Anyone any ideas?</p>
