How do I use a variable to get CSS info on an element?

BivySype

New Member
What I have is the following code to create a div.\[code\]function makeLinkdiv () { gCurrentBlock = $gBlockDivName + $gBlockPointer; var idPointer = gCurrentBlock; var linksBlock = $('<div id ="' + gCurrentBlock + '" class="LinksBlock EditBlock"></div>').appendTo("#canvas"); linksBlock.draggable({containment: "#canvas", scroll: false, grid: [10, 10]}, {cursor: "move", cursorAt: {top: 125, left: 50}}); linksBlock.append('<div class="article_title EditBlock fontCenter fontBold font24">Article Title</div>'); // // log the div data to the div object // var x = gCurrentBlock.css('left'); var y = gCurrentBlock.css('top'); alert ('top is - ' + y + ' left is - ' + x); divData.items.push({ID: $gBlockPointer, Block: gCurrentBlock, posTop : "450", posLeft : "540" }); // // increment the block pointer // $gBlockPointer = $gBlockPointer + 1; //}\[/code\]What happens is that I do not get the CSS properties for top and left. Actually, nothing happens. I know that there must be something wrong in how I am using the variable \[code\]gCurrentBlock\[/code\], but I can't figure it out.
 
Back
Top