Results 1 to 10 of 10

Thread: Javascript Slideshow not working

  1. #1
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript Slideshow not working

    Hi
    Yet another query. I have added a slideshow to my site, the initial image is displaying, but the slideshow does not work.

    Does anyone have suggestions?

    thanks
    groovy1



    <script>
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this header
    // NS4-6,IE4-6
    // Fade effect only in IE; degrades gracefully

    // =======================================
    // set the following variables
    // =======================================

    // Set slideShowSpeed (milliseconds)
    var slideShowSpeed = 5000

    // Duration of crossfade (seconds)
    var crossFadeDuration = 5

    // Specify the image files
    var Pic = new Array() // don't touch this
    // to add more images, just continue
    // the pattern, adding to the array below

    Pic[0] = 'images/picture2.jpg'
    Pic[1] = 'images/picture3.jpg'
    Pic[2] = 'images/picture4.jpg'
    Pic[3] = 'images/picture5.jpg'
    Pic[4] = 'images/picture1.jpg'


    // =======================================
    // do not edit anything below this line
    // =======================================

    var t
    var j = 0
    var p = Pic.length

    var preLoad = new Array()
    for (i = 0; i < p; i++){
    preLoad[i] = new Image()
    preLoad[i].src = Pic[i]
    }

    function runSlideShow(){
    if (document.all){
    document.images.SlideShow.style.filter="blendTrans(duration=2)"
    document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
    document.images.SlideShow.filters.blendTrans.Apply()
    }
    document.images.SlideShow.src = preLoad[j].src
    if (document.all){
    document.images.SlideShow.filters.blendTrans.Play()
    }
    j = j + 1
    if (j > (p-1)) j=0
    t = setTimeout('runSlideShow()', slideShowSpeed)
    }
    </script>
    </head>

    <body id="home">
    <script language="JavaScript1.2">mmLoadMenus();</script>

    <body onLoad="runSlideShow();">

    <div id="Layer1">
    <div id="Background">
    <table width="875" height="581" border="0">
    <tr>
    <td width="190" rowspan="3"><div align="center"><img src="../Images/CentacareLogosml.jpg" alt="Centacare Logo" width="120" height="125" hspace="20" longdesc="../Images/CentacareLogo.jpg" /></div></td>
    <td width="671" height="95"><div align="center" class="style5">Centacare</div></td>
    </tr>
    <tr>
    <td height="27"><div align="center"><span class="style2">New England North West </span></div></td>
    </tr>
    <tr>
    <td height="21">&nbsp;</td>
    </tr>
    <tr>
    <td height="302"><div align="left">
    <ul id="navlist">
    <li class="home"><a href="index.html">Home</a></li>
    <li class="aboutus"><a href="javascript:;" name="link3" id="link1" onmouseover="MM_showMenu(window.mm_menu_1008142321_0,145,-5,null,'link3')" onmouseout="MM_startTimeout();">About Us</a></li>
    <li class="ourservices"><a href="javascript:;" name="link4" id="link1" onmouseover="MM_showMenu(window.mm_menu_1008142321_0,145,-5,null,'link4')" onmouseout="MM_startTimeout();">Our Services</a></li>
    <li class="ourpartners"><a href="ourpartners.html">Our Partners</a></li>
    <li class="news"><a href="news.html">News</a></li>
    <li class="jobs"><a href="jobs.html">Jobs</a></li>
    <li class="helpus"><a href="helpus.html">Help Us</a></li>
    <li class="contactus"><a href="contactus.html">Contact Us</a></li>
    </ul>
    </div></td>

    <td id="VU" height=300 width=400> <div align="center"><img src="../Images/picture1.jpg" name='SlideShow' width=400 height=300> </div></td>
    </tr>
    <tr>
    <td height="122"><div align="center">

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    you have two BODY tags, remove the first

    Code:
    <body id="home">
    <script language="JavaScript1.2">mmLoadMenus();</script>
    
    <body onLoad="runSlideShow();">
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Vic

    When I delete the first body tag. this stops the popup navigation menu from working. and still doesn't make the slideshow work. The first image is displayed, but the next ones don't show.

    thankyou for your help. do you have any other ideas?
    Linda


    </head>

    <body id="home">
    <script language="JavaScript1.2">mmLoadMenus();</script>

    <body onLoad="runSlideShow();">

    <div id="Layer1">
    <div id="Background">
    <table width="875" height="581" border="0">
    <tr>

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    post a link to your page
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  5. #5
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Vic

    here is the link
    http://www.jlkbooks.com.au/Centacare/Website/index.html

    currently the site is under construction. You will also notice that the menu items for "our services" and "about us" are also displaying the same information. I have 2 different menus for these but can't get the appropriate one to display on each correctly.

    thanks for your assistance
    Linda

  6. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    It looks like the paths to your images are wrong.

    In the array, your paths are 'images/picture2.jpg'
    But your main image path is src="../Images/picture1.jpg"

    Make sure your paths are correct (it might help to use absolute paths while testing) and also that you're not mixing uppercase and lowercase.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  7. #7
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Beverley

    thankyou
    perfect.
    am I pushing my luck in asking if you know a solution to why on my navigation menu the 2 popup menus are not displaying correctly. All the information is there but only one of the menus is displaying in both tabs.

    here is the link
    http://www.jlkbooks.com.au/Centacare/Website/index.html

    Thanks again
    Linda

  8. #8
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Hi Linda,

    The quick answer is "yes, I do know why only one popup menu is showing".
    It's because you have the same javascript pasted into your page twice and in both instances it's calling mm_menu_1008142321_0.writeMenus();
    So, even though you have 2 batches of different category pages references in the script (one for each popup) both popups have the same number reference of 1008142321_0

    My long-winded answer is that you should consider changing your menu altogether because the one you're using was written in 2002 and since then, much more robust/stable/attractive/easy-to-install menus have been developed. Its also a bad idea to use a menu that is solely generated via javascript - if a visitors has javascript turned off, they cant get to your sub-pages

    I recommend changing your menu to one that uses HTML markup in the body of your web page with CSS to style and javascript thrown in for a few nice effects. A menu structured this way is also accessible to users without javascript enabled in their browsers.

    This menu in the DD library looks like a good alternative:http://www.dynamicdrive.com/dynamici...smoothmenu.htm but if you want more variety, have a look at the full list here: http://www.dynamicdrive.com/dynamicindex1/indexc.html

    If you need any installation help for a new menu (personally, I'd go for this one: http://www.dynamicdrive.com/dynamici...smoothmenu.htm ), let us know.

    Hope that helps
    Last edited by Beverleyh; 08-10-2010 at 12:57 PM. Reason: i somehow posted the wrong links
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  9. #9
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks Beverley for your advice

    I will try out one of the other menus.

    Linda

  10. #10
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Beverlyh !
    The smoothmenu does not work with javascript disabled, whereas a menu like the superfish does. But I agree that the smooth menu is more slick with the slideup effect and all

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
  •