Skip to:
Content
Pages
Categories
Search
Top
Bottom

Google-hosted jQuery conflicting with default BuddyPress image cropper – help!


  • cancelthisaccountpls
    Participant

    @iamdavidstonegmailcom

    I’m using BuddyPress. I finally figured out how to toggle a login box via jQuery. Unfortunately, calling the Google-hosted jQuery library causes a conflict with the image cropper featured with BuddyPress. I spent all day looking up ways to solve this. No dice.

    If I delete the first line (the one referencing googleapis.com) my image cropper tool functions just fine, but this prevents me from being able to toggle my login box…

    I tried modifying my my bp-functions file without any luck.

    I tried solving the issue using the various “answers” found online, including: wp_enqueue, and others. This is so frustrating. Please help me!

    $(document).ready(function(){
    $(".l1").click(function(){
    $("#login-panel").toggle();
    $("input[type='text']:first", document.forms[0]).focus();
    });
    });
    
Viewing 1 replies (of 1 total)

  • cancelthisaccountpls
    Participant

    @iamdavidstonegmailcom

    solved! I used this code from this page http://snipplr.com/view.php?codeview&id=26963
    Detailed explanation below.

    my final code:

    
    <?php
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js', false, '1.5.0');
    wp_enqueue_script('jquery');
    ?>
    
    $(document).ready(function(){
    $(".l1").click(function(){
    $("#login-panel").toggle();
    $("input[type='text']:first", document.forms[0]).focus();
    });
    });

    The code I added:

    <?php
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js', false, '1.5.0');
    wp_enqueue_script('jquery');
    ?>
    

    This allowed me to delete this line from my original code:

    
    $(document).ready(function(){
    $(".l1").click(function(){
    $("#login-panel").toggle();
    $("input[type='text']:first", document.forms[0]).focus();
    });
    });
    
Viewing 1 replies (of 1 total)
  • The topic ‘Google-hosted jQuery conflicting with default BuddyPress image cropper – help!’ is closed to new replies.
Skip to toolbar