Solved

How do I get a background image to pan slowly without using flash?

Posted on 2010-11-17
11
977 Views
Last Modified: 2012-05-10
How do I get a background image to pan like I did in this flash intro?
http://www.reidsview.com.au/splash.php

I want to do this using a non flash approach do I use Jquery or similar?
0
Comment
Question by:KoolV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
11 Comments
 
LVL 6

Assisted Solution

by:V4nP3rs13
V4nP3rs13 earned 50 total points
ID: 34154708
Add jquery path to your <HEAD>.... then add this:
<script type="text/javascript">
function moveleft() {
$(".stars").animate(marginLeft: "-=200px");
$(".stars").animate(marginLeft: "+=200px");
}

$(function() {
  setInterval("moveleft()", 5000);
}
</script>
0
 

Author Comment

by:KoolV
ID: 34154787
is the .stars the image? do I replace this with the image path?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34154966
0
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 

Author Comment

by:KoolV
ID: 34154975
like this?

How do I add the images?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="css/animate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
</head>

<body>
<script type="text/javascript">
function moveleft() {
$(".stars").animate(marginLeft: "-=200px");
$(".stars").animate(marginLeft: "+=200px");
}

$(function() {
  setInterval("moveleft()", 5000);
}
</script>
</body>
</
0
 
LVL 6

Expert Comment

by:V4nP3rs13
ID: 34154978
.stars is <img src="IMAGE PATH HERE" class="stars"></img>
0
 

Author Comment

by:KoolV
ID: 34155064
So Like this?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="css/animate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.4.4.js"></script>
</head>

<body>
<script type="text/javascript">
function moveleft() {
$(".stars").animate(marginLeft: "-=200px");
$(".stars").animate(marginLeft: "+=200px");
}

$(function() {
  setInterval("moveleft()", 5000);
}
</script>
<img src="IMAGE PATH HERE" class="stars"></img>
</body>
0
 

Author Comment

by:KoolV
ID: 34155106
In tried it like this but it just shows then image and no animation

<body>

<script type="text/javascript">
function moveleft() {
$(".stars").animate(marginLeft: "-=200px");
$(".stars").animate(marginLeft: "+=200px");
}

$(function() {
  setInterval("moveleft()", 5000);
}
</script>
<div class="stars">
<img src="images/background.jpg"/>
</div>
</body>
0
 

Author Comment

by:KoolV
ID: 34155120
Dreamweaver is also showing a syntax error for this line
$(".stars").animate(marginLeft: "-=200px");
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34155122
Also it is not background image animation...
0
 

Accepted Solution

by:
KoolV earned 0 total points
ID: 34156734
I found the solution here
http://www.catswhocode.com/blog/animated-background-image-with-jquery

and here is what I came up with I am very happy with it
http://www.vizyweb.com.au/animation-example/
0
 

Author Closing Comment

by:KoolV
ID: 34221377
The solution I found was so easy and gave such a good result I had to give myself the points but thats for trying you other guys/gals
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question