williamZanelli Posted October 15, 2008 Share Posted October 15, 2008 Hi guys, I was jsut wondering if someone could tell how I could code a popup when someone clicks on a hyperlink. I have terms and conditions on mywebsite.. when a user accepts I want a pop-up-link to the terms The following code does the job, however I want to customise the new window, as in size, scroll, toolbar etc. <a href="terms.html" target="_blank"> Any ideas..? is this a Javascript issue? Thanks in advance William. Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted October 15, 2008 Share Posted October 15, 2008 plz dont use ugly popups try using a modal instead. that way you don't have to worry about a popup blocker and it looks nicer. here is an example for you http://prototype-window.xilinus.com/ there are tons of modal scripts out there just take one you like Quote Link to comment Share on other sites More sharing options...
williamZanelli Posted October 15, 2008 Author Share Posted October 15, 2008 I did using the folliwing code. I agree your appraoch is better, its something I'll look into the future, I have read the < a on click="window.open('http://www.somesite.com/terms.html', 'BBCWorldNewsWindowName', 'left=100,screenX=200,resizable,scrollbars,status'); return false;" target="_blank" > terms and I agree to them. Thanks for the tips. William Quote Link to comment Share on other sites More sharing options...
Maq Posted October 15, 2008 Share Posted October 15, 2008 You need to use a javascript function: function popitup(url) { newwindow=window.open(url,'terms','height=650,width=700,resizable=yes'); if (window.focus) {newwindow.focus()} return false; } Then call your hyperlink like this: Terms Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 16, 2008 Share Posted October 16, 2008 most web browsers will block that nowadays, and they should as its friggin annoying. Quote Link to comment Share on other sites More sharing options...
Maq Posted October 16, 2008 Share Posted October 16, 2008 most web browsers will block that nowadays, and they should as its friggin annoying. I've never had a problem with it, it's a W3 standard. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.