Custom Javascript For Site

by ChristopherBurton

JavaScript

// ===============================
// SLIDER
// ===============================
$(window)
    .load(function () {
    var slides = $("#slider")
        .children("img");
    currentIndex = 0,
    slideCount = slides.length,
    fadeDuration = 1000,
    navigation = $('#process'),
    navCnt = 0,
    navNumFix = 1;

    for (i = 0; i < slideCount; i++) {
        navigation.append('<li><a href="#" class="navItem" data="' + navCnt+++'">' + navNumFix+++'</a></li>&#32;');
    }
    $('.navItem')
        .click(function () {
        var getNavId = $(this)
            .attr('data');
        var prevIndex = currentIndex;
        currentIndex = getNavId;
        if (prevIndex != currentIndex) {
            $(slides[prevIndex])
                .fadeOut(fadeDuration);
            $(slides[currentIndex])
                .fadeIn(fadeDuration);
        }
    });
});



// ===============================
// OUTBOUND LINKS IN NEW WINDOW
// ===============================
jQuery(function ($) {
    $('a[href^="http://"]')
        .not('[href*="http://v2.christopherburton.net"]')
        .attr('target', '_blank');


    // ===============================
    // REMOVE GIMME BAR VIDEO BUTTON
    // ===============================
    jQuery(".gimmebar-video")
        .remove();



    // ===============================
    // ZERO CLIP
    // ===============================
    ZeroClipboard.setMoviePath('http://v2.christopherburton.net/wordpress/wp-content/themes/murtaugh-HTML5-Reset-Wordpress-Theme-8aa6329/_/flash/ZeroClipboard.swf');
    var clip = null;

    function initZeroClip() {
        clip = new ZeroClipboard.Client();
        clip.setHandCursor(true);

        clip.addEventListener('mouseOver', function (client) {
            // update the text on mouse over
            clip.setText($('#fe_text')
                .get(0)
                .value);
        });

        clip.addEventListener('complete', function (client, text) {
            jQuery(".shorturl")
           ...