0

i have this code:

var current;
startOff = $('#all').offset(),
offString = "{top :"+ startOff.top +", left :"+ startOff.left + "}";

current.css(offString);

When "offString" is alerted its fine - eg {top: 123, left: 342}

BUT it doesn't seem to like it, but when the alerted output is added into current.css() inplace of offString, the element is positioned as it should be.

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by EvilOrange
0

solved it myself, no need to truncate it i.e. remove all the " an +'s from startOff and it worked fine.

:)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.