craigsworks.com - Support Forum

Full Version: Dynamic content loaded on mouseover
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey
I just made this very simple use of qtip that might be handy. Smile
I have a list genereted in a php script, every item of the list has an ID, like that :

JS Code
<tr><td class="formation_titre">
   <a id="S-SECU" ...
</td></tr>
<tr><td class="formation_titre">
   <a id="S-OTHER" ...
</td></tr>


I wanted to load some content dynamicaly from this ID using Qtip.
I did so :

JS Code
tab_formations = $('td.formation_titre a');
for(var i=0; i < tab_formations.length; i++) {
   var pof = tab_formations[i];
   var code = pof['id'];
   $(pof).qtip({
      content: { url: 'planning_detail.php5', data: { id: code}, method: 'get' },
      style: { 
         width: 260,
         padding: 2,
         background: '#f2f19c',
         color: 'black',
         textAlign: 'center',
         border: {
            width: 0,
            radius: 5,
            color: '#d4d37e'
         }
      }
   });
}


The whole styling of the tooltip content is ensured by the containing CSS from the mother page.
It works just fine, and it's fast and doesn't load any content at all when not needed !

http://www.oxiane.com

Cheers
Alain
I'm using this script to retrieve info from a database, problem is this script can't recognize the individual Id's of the various mouse overs. Any ideas?
pre, could you provide the code your using so I can take a look? Sounds like you simply need to use an each() loop.
pre Wrote:I'm using this script to retrieve info from a database, problem is this script can't recognize the individual Id's of the various mouse overs. Any ideas?

I just started to look at qTip. I also have a database with the content already inserted but I am not sure where to start to retrieve it. Can you provide an example? Did you resolve the issue you asked about?
Thanks,
Neil
neilgould Wrote:
pre Wrote:I'm using this script to retrieve info from a database, problem is this script can't recognize the individual Id's of the various mouse overs. Any ideas?

I just started to look at qTip. I also have a database with the content already inserted but I am not sure where to start to retrieve it. Can you provide an example? Did you resolve the issue you asked about?
Thanks,
Neil

Yeah I did, using a loop and setting the rel to <span id=content><a href='#' rel='demopage.php?memid=<?php echo $memid ?>

That works in registering the individual id's of the content in the database.
Reference URL's