Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts

    JQuery tipsy add to my site

    ok have added tipsy from here: https://github.com/jaz303/tipsy can anyone tell me how to trigger it 4 title=""?

    eg:
    Code:
    <a href="index.html" title="Home"></a>

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Your post is somewhat lacking in information

    IF you want the tooltips to apply to all a tags:

    Code:
    $('a').tipsy({gravity: 'n'}); // nw | n | ne | w | e | sw | s | se
    The title(s) will be used as the tooltip text.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #3
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    BTW I'm using PowerTips - sexier
    [Require jQuery 1.7 or later]
    Last edited by AndrewGSW; 08-29-2012 at 10:40 PM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #4
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    This still don't work m8........

    U got preview of powertips?

  • #5
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    gonna try powertips now........

  • #6
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    ok that don't work either, i'm using JQuery 1.7, added powertip.js ot the .min.js 1, added css to style.css and used:
    PHP Code:
            <script type="text/javascript">
                $(
    a).powerTip({placements}); // nw | n | ne | w | e | sw | s | se
            
    </script> 
    Last edited by Chris-2k; 08-30-2012 at 10:47 PM.

  • #7
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Code:
     <script type="text/javascript">
           $('a').powerTip({placement: 's'}); // nw | n | ne | w | e | sw | s | se
    </script>
    Notice the two pairs of apostrophes. One needs to be exact

    BTW I notice you still have a transitional doctype but are using HTML5 attributes. But I'll say no more.
    Last edited by AndrewGSW; 08-30-2012 at 12:32 AM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #8
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    ^^ that's whats at my test site, and it's not working........

  • #9
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Quote Originally Posted by Chris-2k View Post
    ^^ that's whats at my test site, and it's not working........
    Works for me! Perhaps the error lies elsewhere..

    Ensure that you load the jQuery library before the PowerTip file.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #10
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    You need to wait for the page to be ready before you can attach powerTip to elements. The elements DO NOT EXIST until the page has fully loaded.

    Didn't I already mention this previously(?).
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #11
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Code:
     <script type="text/javascript">
    $(document).ready(function () {
           $('a').powerTip({placement: 's'}); // nw | n | ne | w | e | sw | s | se
    });
    </script>
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #12
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    ah thx i forgot about that...

    erm how can i set it to any title tags, cos i have input tags too.............

  • #13
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Quote Originally Posted by Chris-2k View Post
    ah thx i forgot about that...

    erm how can i set it to any title tags, cos i have input tags too.............
    Code:
    $('a, input').powerTip({placement: 's'});
    or any other jQuery selector.

    If you only want to target specific elements then give them all a class and apply powerTip to the class instead.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #14
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts
    Off topic btw can u spot any errors here:


    PHP Code:
    $(document).ready(function() {
        $(
    "#close").fadeOut(2000);
        $(
    'a, input').powerTip({placement's'}); // nw | n | ne | w | e | sw | s | se
        
        
    $("#uploadForm").bind('submit', function() {
            var 
    fileInput = $('#file_upload').val();
            var 
    remoteInput = $('#remote_upload').val();

            if(
    document.URL.indexOf("index.php") != -|| document.URL.indexOf("index.php#local") != -1
            {
                if (!
    fileInput == '' || fileInput == '')
                {
                    
    // dont submit the form
                    
    $('#warning').append("Please select an image first <a href='#close' id='close'>close</a>").fadeIn(2000);
                    $(
    '#warning').show();
                    return 
    false;
                } 
                else
                {
                    
    // submit
                    
    return true;
                    
    // show progress bar
                
    }
            }

            
    // Remote file
            
    if(document.URL.indexOf("index.php#remote") != -1
            {
                if (!
    remoteInput == '' || remoteInput == '')
                {
                    
    // dont submit the form
                    
    $('#warning').append("Please add a valid image URL first").fadeIn(2000);
                    $(
    '#warning').show();
                    return 
    false;
                } 
                else
                {
                    
    // submit
                    
    return true;
                    
    // show progress bar
                
    }
            }
        });
        

    }); 
    as it's submitting my form and not showing error........ it was before, can't think what i did.............
    Last edited by Chris-2k; 08-30-2012 at 10:26 PM.

  • #15
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Your copying and pasting skills are somewhat lacking:

    Code:
    if (!fileInput == '' || fileInput == '')
    will always happen because it is checking if fileInput is NOT empty or it IS empty.

    Code:
    if (!fileInput || fileInput == '')
    Similarly for remoteInput.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •