jQuery and Borders

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

jQuery and Borders

Post by volomike »

Anyone here ever tried with jQuery to get graphics to appear in the borders of the viewport, that stay there even when scrolling? For instance, some special effects:

- Fall leaves in the margins
- animated snow that is set to fall only on the left and right margins so many pixels in
- an animated Santa and sleigh that comes into a page from the right and leaves on the left
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: jQuery and Borders

Post by it2051229 »

With jQuery i'm not sure but i think it is possible with javascript... I mean saw a mario game made purely in javascript with all those animation and stuff...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: jQuery and Borders

Post by pickle »

1) & 2) You could do this by setting the leaves to the background of the page, then using jQuery to animate the background

Look into the CSS positions "static" and/or "fixed" - I think "fixed". I forget exactly which one does it, but one of them makes the element stick to the window, not the DOM.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply