Javascript Tooltip / Posts /

Put long tooltip parameters into function to minimize space

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});";}   


But it's not working
Kostya  8 years ago   viewed: 4301    

2 Answers


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   8 years ago
Thank you, you helped me a lot

Kostya   8 years ago


Your name*
(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: