need help with java conflict

  • sherma
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 127

Post 3+ Months Ago

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:

Code: [ Select ]
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();

        });
  1. window.addEvent('domready',function() {
  2.             //settings
  3.             var duration = 40000;
  4.             var length = 800;
  5.             var count = 0;
  6.             var tweener;
  7.             // Executes the standard tween on the background position
  8.             var run = function() {
  9.                 tweener.tween('background-position','-' + (++count * length) + 'px 0px');
  10.             };
  11.             // Defines the tween
  12.             tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
  13.                 duration: duration,
  14.                 transition: Fx.Transitions.linear,
  15.                 onComplete: run,
  16.                 wait: false
  17.             });
  18.             // Starts the initial run of the transition
  19.             run();
  20.         });


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:

Code: [ Select ]
      // Defines the tween


      tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{


AnimateBG.js:15Uncaught TypeError: Object #<Object> has no method 'setStyle'
       
  1.       // Defines the tween
  2.       tweener = $('page_bg').setStyle("background-position","0px 0px").set('tween',{
  3. AnimateBG.js:15Uncaught TypeError: Object #<Object> has no method 'setStyle'
  4.        


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?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • sherma
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 127

Post 3+ Months Ago

I've also tried every variation of adding the following, to no avail:

Code: [ Select ]
 <script type="text/javascript">jQuery.noConflict();</script>
  • sherma
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 127

Post 3+ Months Ago

never mind, I just replaced the jquery.js file with

Code: [ Select ]
<script type="text/javascript" src="http://ajax.googleapis. com/ajax/libs/mootools/1.2.4/mootools-yui-compressed. js">


and now it all works together

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 73 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.