Javascript Tooltip / Posts /

Put long tooltip parameters into function to minimize space

0
Is that possible to convert from this:

<a href="#" onclick="tooltip.pop(this, 'Some text', {sticky:false,position:2,cssClass:&quot;advtip&quot;,hideDelay:1000,maxWidth:320});">foo</a>

into this:

<a href="#" onclick="tip(this,'mypop');">foo</a>

Here is my JavaScript:

<script type="text/javascript">

     function tip(input,section) {
        
         if (section == "mypop") {input.value = "tooltip.pop(this, 'Some text', {sticky:false,position:2,cssClass:&quot;advtip&quot;,hideDelay:1000,maxWidth:320});";}   
        
     }

</script>

But it's not working
Kostya  2 years ago   viewed: 1835    

2 Answers

0

It should be:

function tip(input,section) { if (section == "mypop") { tooltip.pop(input, 'Some text', {sticky:false,position:2, cssClass:"advtip", hideDelay:1000, maxWidth:320}); } }
Milo   2 years ago
0
Thank you, you helped me a lot


Kostya   2 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: