navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Open a new window with bgcolor set

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Open a new window with bgcolor set
Page: [1]
 
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.

(in reply to cyber5)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Open a new window with bgcolor set
Page: [1]
Jump to: 1





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