Results 1 to 2 of 2

Thread: jquery slideshow javascript marquee not working on same page

  1. #1
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default jquery slideshow javascript marquee not working on same page

    Hello
    I have a marquee on my page with this code:
    Code:
    <script type="text/javascript" src="marquee/scroll.js"></script>
    <script type="text/javascript">
    (function(){
    
        window.addEvent('domready',function(){
            var  jvnewintro = $$('.scroll-intro')[0];
            if(!jvnewintro) return;
            jvnewintro.setStyle('overflow','hidden');
            var
                fx = new Fx.Scroll(jvnewintro),
                delay = 3000
            ;
            var step = function(){
                setTimeout(function(){
                    var toTop = jvnewintro.scrollTop + 50;
                    if(toTop >= jvnewintro.scrollHeight - jvnewintro.getStyle('height').toInt() + 50) toTop = 0;
                    fx.scrollTo(0,toTop).chain(function(){
                        step();
                    });
                },delay);
            }
            step();
        });
        
    })();
    </script>
    and then i have a slideshow with this code:
    Code:
    <script type="text/javascript" src="scripts/jquery.js"></script>
    <script type="text/javascript" src="scripts/jquery.slideshow.min.js"></script>
    	
    <script type="text/javascript">
    $(document).ready(function() {
    			$('#slideshow').slideshow({
    				timeout: 5000,
    				type: 'sequence',
    				pauselink: 'pause1',
    				pausecallback: function(self){
    					self.html('Play')
    				},
    				playcallback: function(self){
    					self.html('Pause');
    				}
    			});
    			
    	        });
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    </script>
    when i put them together, only the one that is first works, no matter which one it is.
    How can i make them both work together on the page ? I am searching for the answer but can't seem to find exactly what i need.
    please help thanks.
    Last edited by jscheuer1; 04-15-2012 at 02:32 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,004
    Thanks
    44
    Thanked 3,203 Times in 3,165 Posts
    Blog Entries
    12

    Default

    Code:
    new Fx.Scroll
    implies that you are using MooTools on the page, so you left something out from your post - a script tag for the MooTools script library. It probably comes before:

    Code:
    <script type="text/javascript" src="marquee/scroll.js"></script>
    What you can do is place the second code block first, before the MooTools tag and edit it to look like so:

    Code:
    <script type="text/javascript" src="scripts/jquery.js"></script>
    <script type="text/javascript" src="scripts/jquery.slideshow.min.js"></script>
    	
    <script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function($) {
    			$('#slideshow').slideshow({
    				timeout: 5000,
    				type: 'sequence',
    				pauselink: 'pause1',
    				pausecallback: function(self){
    					self.html('Play')
    				},
    				playcallback: function(self){
    					self.html('Pause');
    				}
    			});
    			
    	        });
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    </script>
    As long as jquery.slideshow.min.js is written in such a way that it can operate in noConflict mode, that will work. Both scripts should now function.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    shocolin (04-19-2012)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •