I'm running this on all of the pages on a website, it's to make an image at the top of the page scroll across the screen. It works on every page except one, and that is one that I have lightBox on:
window.addEvent('domready',function() {
//settings
var duration = 40000;
var length = 800;
var count = 0;
var tweener;
// Executes the standard tween on the background position
var run = function() {
tweener.tween('background-position','-' + (++count * length) + 'px 0px');
};
// Defines the tween
tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
duration: duration,
transition: Fx.Transitions.linear,
onComplete: run,
wait: false
});
// Starts the initial run of the transition
run();
});
- window.addEvent('domready',function() {
- //settings
- var duration = 40000;
- var length = 800;
- var count = 0;
- var tweener;
- // Executes the standard tween on the background position
- var run = function() {
- tweener.tween('background-position','-' + (++count * length) + 'px 0px');
- };
- // Defines the tween
- tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
- duration: duration,
- transition: Fx.Transitions.linear,
- onComplete: run,
- wait: false
- });
- // Starts the initial run of the transition
- run();
- });
What happens is that the lightBox works, but the animation for the image at the top of my page stops moving and I get this error beneath this line in the above .js:
// Defines the tween
tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
AnimateBG.js:15Uncaught TypeError: Object #<Object> has no method 'setStyle'
- // Defines the tween
- tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
- AnimateBG.js:15Uncaught TypeError: Object #<Object> has no method 'setStyle'
-
I have found if I take the jquery.js file out of the header, the tween begins to work again, but when any of the images in lightBox are clicked on, they open in a new page instead of popping out on the same page the way they should.
So now that I know which file is conflicting, how do I go about finding the code that needs to be modified?