I have a jQuery object called window.offset.
This object has another object called search.
It has two values, top & left.
Eg:
window.offset.search = {top:200, left:150}
I want to pass this ‘search’ object as a variable called ‘id’.
How to pass this variable to the window.offset object and get the top & left value.
I tried as this. But it doesn’t work.
var offset = 'window.offset.'+id
console.log(offset.left); //undefined
Here’s what you can do :