|
| |
|
|
cyber5
Posts: 1 Joined: 8/21/2008 Status: offline
|
Open a new window with bgcolor set - 8/21/2008 19:00:04
I am opening a new window onClick, and would like to set the bgcolor of the new window. I am using the following code, found in this forum a few years back, and can't figure out how to set the bgcolor. Please advise: <script language="javascript"> var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } </script> and add this inside of your <a></a> tags onclick="NewWindow(this.href,'name','500','350','yes');return false" example: <a onclick="NewWindow(this.href,"name,'500','350','yes');return false" href="link here">click here</a> Thanks!
|
|
|
|
TexasWebDevelopers
Posts: 227 Joined: 2/22/2002 From: Status: offline
|
RE: Open a new window with bgcolor set - 8/22/2008 16:03:51
You're opening a new window--not creating a new page on the fly. If you open page1.html with your javascript you still set the bg color in the page1.html styles.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|