PDA

View Full Version : Auto scroll a iframe without moving background



StealthRT
Apr 3rd, 2007, 02:07 AM
Hey all i have some code that allows me to scroll an iframe using some javascript to acts as a up/down scroll bar. Problem being that when i scroll down the picture in the background also scrolls with it. I have set the background-repeat: no-repeat but that doesnt seem to work.

I just want the text to scroll or anything else i have inside the table.

Here is the demo site im working on:
http://www.nkphotography.net/nk2k7off.html

Is there any way to solve this problem? :confused:

Thanks! :)
David

_Aerospace_Eng_
Apr 3rd, 2007, 02:25 AM
Change

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #000000;
background-image: url(images/NK2K7on_15.jpg);
background-repeat: no-repeat;
background-position:
}
to this

body {
margin:0;
padding:0;
background:#000 url(images/NK2K7on_15.jpg) no-repeat top left fixed;
}

jlhaslip
Apr 3rd, 2007, 02:28 AM
background-attachment: fixed might work in the middle.html background image

body {MiddlePage.html (line 8)
background-color:#000000;
background-image:url(images/NK2K7on_15.jpg);
background-repeat:no-repeat;
background-attachment: fixed
margin:0px;
}
*edit*
seems we were cross posting. One of these should work.

StealthRT
Apr 3rd, 2007, 02:29 AM
Change

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #000000;
background-image: url(images/NK2K7on_15.jpg);
background-repeat: no-repeat;
background-position:
}
to this

body {
margin:0;
padding:0;
background:#000 url(images/NK2K7on_15.jpg) no-repeat top left fixed;
}

Hey thanks there _Aerospace_Eng_ / jlhaslip. That seemed to work with the text but is there any way i can "hide" whatever it is i need to go behind the "border" of that picture in the background? Scrolling all the way over it doesnt look good for the overall product :)

David

_Aerospace_Eng_
Apr 3rd, 2007, 06:58 PM
Not sure I understand what you mean.

StealthRT
Apr 3rd, 2007, 10:57 PM
http://www.nkphotography.net/MiddlePage.html

That link above is for the iframe thats loaded into the middle of the site. On the main site (index.html) there are 2 arrows on the right side. One to scroll up and the other to scroll down the iframe page. However with the code i am using now, i am unable to hide the text on the middlepage so that it wont look weird on the index site when its view (as in the text goes off the "border" of the middle picture.

Hope this helps...

David

_Aerospace_Eng_
Apr 4th, 2007, 03:31 AM
Put some padding or margins on the element that contains the text. Put a div around the text if you don't have one yet and add margin or padding to the left or right.