Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member John Mc Grath's Avatar
    Join Date
    Sep 2011
    Location
    Ireland
    Posts
    80
    Member #
    29172
    Liked
    3 times
    Does anyone know how to fix this Javascript code? It is for a slideshow on my site http://www.mediareviewzone.com which works fine by itself. When its introduced into my page it does not function properly. It uses unordered list for the slides which are organised using the z index. It works fine going backwards or higher in the z index but when you go forwards it makes the elements in my navigation bar, which are also in a unordered list, disappear. The li in the nav bar have a class but the slideshows li don't. I never studied Javascript and I found this example on the web. Here is the code, hopefully you can help, thanks.

    $(document).ready(function(){

    var slideShow = $('#slideShow'),
    ul = slideShow.find('ul'),
    li = ul.find('li'),
    cnt = li.length;
    // As the images are positioned absolutely, the last image will be shown on top.
    // This is why we force them in the correct order by assigning z-indexes:

    updateZindex();


    // Fallback for Internet Explorer and older browsers

    slideShow.bind('showNext',function(){
    $('li:first').fadeOut('slow',function(){
    $(this).remove().appendTo(ul).show();
    updateZindex();
    });
    });

    slideShow.bind('showPrevious',function(){
    var liLast = $('li:last').hide().remove().prependTo(ul);
    updateZindex();
    liLast.fadeIn('slow');
    });


    // Listening for clicks on the arrows, and
    // triggering the appropriate event.

    $('#previousLink').click(function(){
    if(slideShow.is(':animated')){
    return false;
    }

    slideShow.trigger('showPrevious');
    return false;
    });

    $('#nextLink').click(function(){
    if(slideShow.is(':animated')){
    return false;
    }

    slideShow.trigger('showNext');
    return false;
    });

    // This function updates the z-index properties.
    function updateZindex(){

    // The CSS method can take a function as its second argument.
    // i is the zero-based index of the element.

    ul.find('li').css('z-index',function(i){
    return cnt-i;
    });
    }
    });
    Im pretty new to web design but I am learning fast. I will help if I can.
    Check out my sites http://www.mediareviewzone.com http://www.iamrobsmith.com

  2.  

  3. #2
    Member John Mc Grath's Avatar
    Join Date
    Sep 2011
    Location
    Ireland
    Posts
    80
    Member #
    29172
    Liked
    3 times
    Its alright got it working, just got a completely new design in the end. Works perfectly.
    Im pretty new to web design but I am learning fast. I will help if I can.
    Check out my sites http://www.mediareviewzone.com http://www.iamrobsmith.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:26 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com