Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-29-2012, 09:23 PM   PM User | #1
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
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>
Chris-2k is offline   Reply With Quote
Old 08-29-2012, 09:34 PM   PM User | #2
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 08-29-2012, 09:37 PM   PM User | #3
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
BTW I'm using PowerTips - sexier
[Require jQuery 1.7 or later]
__________________
"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

Last edited by AndrewGSW; 08-29-2012 at 09:40 PM..
AndrewGSW is offline   Reply With Quote
Old 08-29-2012, 10:15 PM   PM User | #4
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
This still don't work m8........

U got preview of powertips?
Chris-2k is offline   Reply With Quote
Old 08-29-2012, 10:27 PM   PM User | #5
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
gonna try powertips now........
Chris-2k is offline   Reply With Quote
Old 08-29-2012, 11:04 PM   PM User | #6
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
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 09:47 PM..
Chris-2k is offline   Reply With Quote
Old 08-29-2012, 11:29 PM   PM User | #7
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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.
__________________
"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

Last edited by AndrewGSW; 08-29-2012 at 11:32 PM..
AndrewGSW is offline   Reply With Quote
Old 08-30-2012, 12:05 AM   PM User | #8
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
^^ that's whats at my test site, and it's not working........
Chris-2k is offline   Reply With Quote
Old 08-30-2012, 12:31 AM   PM User | #9
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 08-30-2012, 12:37 AM   PM User | #10
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 08-30-2012, 12:39 AM   PM User | #11
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 08-30-2012, 02:08 PM   PM User | #12
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
ah thx i forgot about that...

erm how can i set it to any title tags, cos i have input tags too.............
Chris-2k is offline   Reply With Quote
Old 08-30-2012, 02:58 PM   PM User | #13
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 08-30-2012, 04:56 PM   PM User | #14
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
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 09:26 PM..
Chris-2k is offline   Reply With Quote
Old 08-30-2012, 07:13 PM   PM User | #15
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:59 AM.


Advertisement
Log in to turn off these ads.