sorry, that last bit of code has
append not add in the line below.
however i'm still stuck, the link does nothing when clicked on until a
page reload...

$('#hiddenleft').append('<a href="#" class="'+boxName+'">'+boxName+'</
a>');



On May 19, 11:07 pm, thekman <[EMAIL PROTECTED]> wrote:
> Hi all,
> I am trying to add links to a div when another div is clicked.
> The links get added fine, but they do not work when clicked. However i
> am also saving the value to a cookie & display them on page refresh,
> at this stage they do work as expected.
> Any ideas on how I can get the links to work just after they are added
> to the div without a page refresh. Code used below.
>
> $('.closeleft').click(function() {
>   var $this = $(this);
>   var boxName = $this.parents(".leftBoxContainer").attr("id");
>   $(this).parents(".leftBoxContainer").hide();
>
> $.cookieJar('leftBoxClosed').set($this.parents(".leftBoxContainer").attr("id"),
> 'hidden');
>   $('#hiddencontent').show();
>   $('#hiddenleft').add('<a href="#" class="'+boxName+'">'+boxName+'</
> a>');
>   return false;
>
> });

Reply via email to