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.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22
  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    Hi guys
    Working on a wordpress project, installed a slider which didnt display correctly and contacted the plugin author to ask for guidance.
    They said that the following was causing a jquery conflict in wordpress:
    Code:
        $(function() {
            function launch() {
                $('#sign_up').lightbox_me({centered: true, onLoad: function() { $('#sign_up').find('input:first').focus()}});
                $('#popup1').lightbox_me({centered: true, onLoad: function() { $('#popup1').find('input:first').focus()}});
                $('#popup2').lightbox_me({centered: true, onLoad: function() { $('#popup2').find('input:first').focus()}});
                $('#popup3').lightbox_me({centered: true, onLoad: function() { $('#popup3').find('input:first').focus()}});
            }
    He told me to change the starting $ to \"jQuery\" and this did solve the problem, the slider works fine.

    It did however manage to break the lightbox pop ups, because I have enquiry links with an ID of "#head_thumb1" which when clicked, load a pop up with an enquiry form, the code for this is the above also with:

    Code:
            $('#head_thumb1').click(function(e) {
                $("#popup1").lightbox_me({centered: true, onLoad: function() {
                    $("#popup1").find("input:first").focus();
                }});
                e.preventDefault();
            });
    Any ideas why this would be broke, and how to fix it, thanks :-)

    p.s. if i put it all back to how it was, it still for some reason doesn't work, however it did before i started fiddling.

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Do you have two versions of jQuery running at once? If so, take the older one out. That $ function should work fine.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    Quote Originally Posted by TheGAME1264, post: 250578, member: 428
    Do you have two versions of jQuery running at once? If so, take the older one out. That $ function should work fine.
    Not that I can see, however was using a very old version of jquery so have updated the URL to //ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js but still no lightbox pop-ups :-(

    Url: http://tinyurl.com/cvp23h5

    (Its the "enquire now" on the featured offers at the top which are supposed to load a lightbox form.)

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    The original code should have been fine. I looked at the page and both should run as they are. You've got invalid syntax going on because of the * characters.

    Put it back the way it was originally and let's see what's going on.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Try this for the first line of that lightbox function:
    Code:
    $(document).ready(function() {
    It doesn't look like the function itself has even been called.

    EDIT: stupid TinyMCE formatting.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    Right, have looked at how to integrate lightbox_me once again and all I have in the source is:

    Code:
    <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                function launch() {
                    $('#popup1').lightbox_me({centered: true, onLoad: function() { $('#popup1').find('input:first').focus()}});
                }
               
                $('#head_thumb1').click(function(e) {
                    $("#popup1").lightbox_me({centered: true, onLoad: function() {
                        $("#popup1").find("input:first").focus();
                    }});
                   
                    e.preventDefault();
                });
               
               
                $('table tr:nth-child(even)').addClass('stripe');
            });
        </script>
    #popup1 is a hidden div in my footer as instructed by lightbox_me and when #head_thumb1 is clicked, it should pop-up with #popup1, right?

    Except it doesn't.

    And also, with the above, the slider is not working again.

  8. #7
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    Update:

    I have just removed
    Code:
    <script src="http:////ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    as on viewing the full source, I see wordpress uses built in jquery here:
    Code:
    <script type='text/javascript' src='http://dt10012f.designs4training.co.uk/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
    This has caused the slider to function but still no pop-ups

  9. #8
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You've got an error somewhere in the popup Javascript. it shows up in the console view in Chrome.

    I'd remove the WP version and use the Google version. It's a later version.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  10. #9
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    I would too but the wordpress version is not in my source, it is loading automatically and I dont know how to remove it. When I paste my latest version back, the slider stops functioning.

  11. #10
    Member
    Join Date
    Jul 2011
    Posts
    95
    Member #
    28555
    Liked
    1 times
    I see in the chrome javascript console it says on line 89: Uncaught TypeError: Property '$' of object [object Object] is not a function

    This line is: $(document).ready(function() {


Page 1 of 3 1 2 3 LastLast

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 05:01 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com