Developer's Forum

Solving daily Web Developing problems

Developer's Forum Logo

add code in magento

  1. Krite

    into the Matrix
    Joined: Nov '10
    Posts: 129

    offline

    from this code

    <script src='<?php echo Mage::getBaseDir() . "js/jquery.nivo.slider.js" ?>'></script>

    if i want add in this code but where is line to add in this code. please tech me. thank you.

    <script>
    function slideSwitch() {
    var active = jQuery('.slideshow .items .active');
    // use this to pull the images in the order they appear in the markup
    var next = jQuery(active).next().length ? jQuery(active).next() : jQuery('.slideshow .items div:first');
    jQuery(next).css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
    jQuery(active).removeClass('active');
    });

    jQuery(active).animate({opacity:0.0}, 1000, function(){
    });
    }

    // execute your scripts when the DOM is ready. this is mostly a good habit
    jQuery('document').ready(function() {
    var active = jQuery('.slideshow .items .active');
    if ( active.length == 0 ) {
    active = jQuery('.slideshow .items div:first');
    active.addClass('active').animate({opacity: 1.0}, 1000);
    }

    jQuery(function() {
    setInterval( "slideSwitch()", 5000 );
    });
    });
    </script>

    Posted 5 months ago #
  2. Rick

    Administrator
    Joined: May '10
    Posts: 397

    offline

    You should add it in the footer.

    Someting like: Template -> Page -> HTML -> Footer

    First the NIVO file and then the JavaScript functions.

    Posted 5 months ago #

Reply

You must log in to post.