Results 1 to 2 of 2

Thread: Multiple onLoads

  1. #1
    mackenzie Guest

    Multiple onLoads

    Hi guys

    Hopefully a quick question and answer, I am having trouble using multi onload events in my <Body>. I am using the Scroller to control a news reel that runs along the top and I also want to utilise a photo lightbox on the same page. I have had both working individually but can not get them working together.

    Code:
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    
    <script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
    	<script type="text/javascript" src="js/jquery.li-scroller.1.0.js"></script>
    	<script type="text/javascript">
    		$(function(){ 
    		    $("ul#news-scroller").liScroll({travelocity: 0.04}); 
    		}); 
    </script>
    
    
    <body onload="clickMenu('gallery'); initLightbox();">
    If anyone could point me in the right direction that would be awesome.

    Thanks in advance.

    Mackenzie.

  2. #2
    Join Date
    Feb 2007
    Location
    Ireland
    Posts
    1,007
    I'd never claim to be a JS pro but what about creating a function to manage onload functions?

    So when the script is called, onLoad="myloadingfunc();"
    Code:
    function myloadingfunc() {
        clickmenu('gallery);
        initLightbox();
    }
    “The best thing about a boolean is even if you are wrong, you are only off by a bit.”

Similar Threads

  1. Multiple AJAX requests
    By Luis in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 07 Mar 2006, 09:36 PM

Posting Permissions

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