Div that moves as you scroll
- Started
- Last post
- 6 Responses
- GeorgesII0
Wanted to know something similar,
How would you use jquery to do something similar to mimeartist's site,
I have two flash site that are loaded one next to the other and I want to be able to move the window from one site to another,
possible?
- neverblink0
set window overflow to hidden
on button call jQuery script
animate body left margin to -1*(body.width)and back
on button call jQuery script
animate body left margin to 0- thank you, will try it right nowGeorgesII
- this is proto-code btw not real jquery - just so you don't blame me it doesn't workneverblink
- nah, I looked in the docs,
thanks for showing the wayGeorgesII
- neverblink0
in above script, change body.width to the width of the flash movie.. otherwise it will scroll both movies out of frame
- ismith0
CSS
.divclass { position: fixed; }?
- acescence0
the jquery that does it on the page you linked is at the bottom if you view source..
$(document).ready(function() {
cartYLoc = parseInt($(cartID).css("top").su...
$(window).scroll(function() {
var offset = cartYLoc;
if(cartYLoc - $(document).scrollTop() < 0) {
offset = $(document).scrollTop();
}
if (offset != 500) offset = offset - bottom_offset;
$(cartID).animate({top:offset...});
});
- Hall0
i find it annoying.
obviously has its place though.