jquery interactive popup windows
Can any one provide link for jquery pop window (not div element) plugin. Window should open on mouse over/clic开发者_如何学运维k events with loading image on link before window open. No light box is required.
Example : infolink urls for advertisement
If you want to interact with the child and the parent window using javascript, then perhaps you should look into window.opener
property from the child to call parents global JS function. Like
In parent and child window define a global function
function Connector(msg){
$('body').append(msg+'<br/>');
}
From parent, save the window instance that you open
var child = window.open('child.html');
after the window is open [you'll have to figure it out how to wait for that] call
child.Connector('parent calling child');
Similarly, from the child call Connector()
function in the parent of the child window like
window.opener.Connector('child calling parent');
Hope this helps you, below is the html and JS I used
For the Parent html
function Connector(msg){ $('body').append(msg+'
'); } $(document).ready(function(){ var child = null; $('#test_btn').bind('click', function(){ var newwin = window.open('new_wind.html'); $('#call_child').show(); child = newwin; if(window.console){ console.log($child.contents().find('body').length); console.log(newwin); console.log($child); } return false; }); $('#call_child').bind('click', function(){ if(child){ child.Connector('parent calling child'); } }); });
`
Hello World`
For the child:
$(document).ready(function(){ if(window.opener){ window.opener.Connector('child calling parent'); } else{ alert('no parent: window.opener'); } }); function Connector(msg){ $('body').append(msg+'
'); }
精彩评论