Uhm. Well i am really not well equipped with jquery knowledge therefore giving me the complete code would be the solution. =]

The function will be
1.get the 70% width of the browser's screen.
2.convert that width into its corresponding px value
3.set the max width of the #mainContainer using the value got from the conversion/calculation.

Need help thanks.
here is the css style for the container i want to set max-width with.

#mainContainer
     {
	background-image:url(bg3.jpg);
	background-repeat:repeat;
	background-color:#999;
	width:70%;
	padding:0;
    min-width:940px;/* 	940px absolute value of 70%. *   
	margin:0 auto;
    min-height:100%;
	 /*serves as a divider from content to the main container*/
	-webkit-border-radius: 10px;
    border-radius: 10px;
    }

Recommended Answers

All 2 Replies

Member Avatar for stbuchok

Just out of curiosity, why not set the max-width in CSS to 70%? Why do it through JavaScript?

I want to get px value of the 70% of the container in the browser screen. This function is for the very purpose of setting an absolute value of max-width so that if i would zoom out the browser view the layout of the page wont mess up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.