I'm pretty sure I understand what you're saying, and if it worked, it would be a magnetic levitation device, not an anti-gravity device. It may create a magnetic field strong enough to push against the earth's magnetic field. If it generated enough force to offset the effects of gravity on its mass, it would appear to float in mid-air. But it'd be completely worthless in interplanetary space.
Currently, we have no way of creating a true anti-gravity device because we don't fully understand gravity. We know that all mass has it. At one time it was suspected that there was a quantum particle called a graviton that causes it. But last I heard, gravity may be caused by some sort of spillage from one of the 11 collapsed dimensions. Until we're able to manipulate collapsed dimensions (which would be dangerous, to say the least), I've no idea how we could create an anti-gravity device.