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.

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

:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.