Tuesday, 15 May 2012

javascript - Position div on hover inside iframe -



javascript - Position div on hover inside iframe -

i have iframe loads page displays multiple images, when hovering images div shows displaying info, problem how position div, script worked fine before putting within iframe

var innerhtml1 = '<div id="preview" style="z-index:10000;">all info</div>'; $("body").append(innerhtml1); if (ie) { // grab x-y pos.s if browser ie tempx = event.clientx + document.body.scrollleft tempy = event.clienty + document.body.scrolltop } else { // grab x-y pos.s if browser ns tempx = e.pagex tempy = e.pagey } if (tempx < 0){tempx = 0} if (tempy < 0){tempy = 0} if(leftorright=="right") { if(is_chrome == false) { $("#preview") .css("top",(document.documentelement.scrolltop+120) + "px") // .css("left",(e.pagex-470) + "px") .css("left",(tempx-470) + "px") .fadein("fast"); } else { $("#preview") .css("top",(document.documentelement.scrolltop+120) + "px") // .css("left",(e.pagex-470) + "px") .css("left",(tempx-470) + "px") .fadein("fast"); } } else { if(is_chrome == false) { $("#preview") .css("top",(document.documentelement.scrolltop+120) + "px") .css("left",(tempx-470) + "px") .fadein("fast"); } else { $("#preview") .css("top",(document.documentelement.scrolltop+120) + "px") .css("left",(tempx+30) + "px") .fadein("fast"); } }

javascript jquery iframe

No comments:

Post a Comment