jQuery offset issue: not changing the position of a SWF
I have written code to overlay a SWF above a HTML button. I use the offset function from jQuery to get the coordinates and move the SWF. Unfortunately, it seems like the SWF do not get moved.
var offset = $("#button").offset();
$("#SWF").offset(offset);
$("#SWF").css({'left':offset.left, 'top': offset.top});
$("#SWF").offset({ top: 10, left: 30});
I have tr开发者_运维知识库ied those 3 lines, and the offset never changed, I do not know why.
I hope someone could please help me.
EDIT:
I realized that:
$("#SWF").css({'left': offset.left, 'top': offset.top});
is working but actually I was using DOMWindow, I had to change the position and the z-index. I still have one issue, the SWF is not directly above the button, it's right underneath it. Does anyone know why please?
Thank you very much,
Rudy
Set wmode to "transparent" on the SWF, and make sure that the z-index of the SWF is higher than the z-index of the button.
精彩评论