开发者

How to hide an iframe after clicking with JQuery?

im trying to setup a simple panel that follows the mouse movements with an external iframe. And i want to hide it after its clicked. What i've got so far:

<div id="wrapper45" onclick="hideitnow(this)" style="position: absolute; opacity: 0.5; filter: alpha(opacity = 50); margin-left: -50px; z-index: 100;"> 
    <scr开发者_如何学编程ipt src="thescriptthatcallstheframe"></script>
</div> 
<script type="text/javascript"> 
    jQuery( document ).ready( function() {
        $( "#link" ).mousemove( function( e ) {
            $( '#wrapper45' ).css( {
                top: e.pageY - 50,
                left: e.pageX + 25
            } );
        } );
    } )
</script> 

the hideitnow function:

<script type="text/javascript"> function hideitnow(elem){ document.getElementById(elem).style.display = 'none'; } </script>

does anyone have a clue why its not working!? thx in advance!


<script type="text/javascript"> 
    $(function() {
        $("#link").mousemove(function(e) {
            $('#wrapper45').css({
                top: e.pageY - 50,
                left: e.pageX + 25
            });
        });
        $('#wrapper45').live('click', function() {
            $(this).css({display: 'none'});
        });
    });
</script> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜