jamesjmann Posted May 15, 2011 Share Posted May 15, 2011 I created a javascript function that covers the entire screen with a semi transparent black png when a user clicks a button to pop up a dialog box. problem is, the png doesn't repeat to cover the entire web page. it covers the entire width of the page and the entire height of the computer screen, but when you scroll down, the png stops repeating. hope you guys know what im talking about but heres my css for the div that holds that transparent png. background-image: url(../images/template/faded-bg.png); background-repeat: repeat; top: 0px; left: 0px; position: absolute; display: none; width: 100%; height: 100%; background-attachment: fixed; background-attachment does nothing. i tried both fixed and scroll but no luck. anyone know how to fix this problem? Quote Link to comment https://forums.phpfreaks.com/topic/236498-need-css-help-for-javascript-function/ Share on other sites More sharing options...
cssfreakie Posted May 16, 2011 Share Posted May 16, 2011 Change position absolute in to position:fixed; and remove the background-attachment property, (since that is not what it's meant for). if you want this to work for ie6 and lower, you will need to use javascript to mimic te fixed property. Instead of the above you could also use javascript to get the height of the document and set that as the height of the div. That is something else than setting it to 100%. Quote Link to comment https://forums.phpfreaks.com/topic/236498-need-css-help-for-javascript-function/#findComment-1215842 Share on other sites More sharing options...
jamesjmann Posted May 16, 2011 Author Share Posted May 16, 2011 Change position absolute in to position:fixed; and remove the background-attachment property, (since that is not what it's meant for). if you want this to work for ie6 and lower, you will need to use javascript to mimic te fixed property. Instead of the above you could also use javascript to get the height of the document and set that as the height of the div. That is something else than setting it to 100%. OMG Thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/236498-need-css-help-for-javascript-function/#findComment-1216146 Share on other sites More sharing options...
cssfreakie Posted May 16, 2011 Share Posted May 16, 2011 OMG Thank you so much! your welcome, say hello from me to your god Quote Link to comment https://forums.phpfreaks.com/topic/236498-need-css-help-for-javascript-function/#findComment-1216151 Share on other sites More sharing options...
jamesjmann Posted May 23, 2011 Author Share Posted May 23, 2011 OMG Thank you so much! your welcome, say hello from me to your god Lol, will do =p Quote Link to comment https://forums.phpfreaks.com/topic/236498-need-css-help-for-javascript-function/#findComment-1219189 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.