简体   繁体   中英

javascript popup window as iframe, div,or window always on top on changing links

in web page, is it possible to open 'popup' frame as:
div or iframe or even window, so :
1. the user can see both , the pop window and the 'main' page ?

  1. on change link in specific domain, the popped frame will remain always on top
    ( with additional code if needed)

  2. the user can see both the frame and the main a and get focus with mouse click on the popped and main

  3. possibility to access objects/events from popped and main. (in iframe even on different origin)

  4. in standard desktop application, we can achieve it, as MDI forms, for example.

    code sample or link will help.

Example:

 $("#simple").dialog( { autoOpen: false, open: function() { $("#withIframe").dialog( "moveToTop" ); }, focus: function( event, ui ) { $("#withIframe").dialog( "moveToTop" ); } }); $("#withIframe").dialog( { autoOpen: false, open: function(ev, ui){ $('#if').attr('src','http://www.jQuery.com'); $(this).dialog( "moveToTop" ); } }); $(".link").click(function() { $("#simple").dialog('option','modal',$('#isModal').prop('checked')).dialog( "open" ); }); $(".link_iframe").click(function() { $("#withIframe").dialog( "open" ); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://code.jquery.com/ui/jquery-ui-git.css" rel="stylesheet"/> <script src="https://code.jquery.com/ui/jquery-ui-git.js"></script> <label><input type='checkbox' id='isModal' /> Is Modal? </label> <a href='#' class='link'>link</a> <a href='#' class='link_iframe'>link (iframe)</a> <div id='simple'> <h2> Simple dialog </h2> </div> <div id='withIframe'> <iframe id='if' src=''></iframe> </div> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM