You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Nested divs are giving me fits.. suggestions? Created Oct 11, 2009

This thread is solved

Views: 1125     Replies: 1     Last reply Oct 15, 2009  
You must login first before you can use this feature

cowboysdude

Posts: 14

Registered:
Mar 9, 2009

Nested divs are giving me fits.. suggestions?

Posted: Oct 11, 2009

This is what I have so far but can't seem to get the tooltip to fire... Here's the code...



<div id="scrollBox">
<div id="demotip"> </div>
<center>
<?php
$lines = file('modules/mod_norven/edit/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($lines as $n_line)
{
    list($n_id, $n_vid, $n_pic, $n_title) = explode('-', $n_line);
	print '<p><a class=info href="'.$n_url.'/'.$n_path.'/'.$n_vid.'" rel="lightbox[flash 740 460]" ><div class="infobox"><div id="box"><div id="demo"><img src="'.$n_url.'/modules/mod_norven/images/vidimg/'. $n_pic .'" alt="no picture" height="60" width="100" title="'. $n_title .'"  /></a></div></div></div></p><br />';
}
?>
</div>

<script>
$(document).ready(function() { 
    $("#demo img[title]").tooltip('#demotip'); 
});
</script>

You can tell what's its looking for.. it reads the title from $n_title which it's doing just not displaying the tooltip...

Suggestions?

TIA!

degenerate

Posts: 156

Registered:
Sep 19, 2008

» Nested divs are giving me fits.. suggestions?

Posted: Oct 15, 2009

Reply to: Nested divs are giving me fits.. suggestions?, from cowboysdude
You can't have multiple elements with the same ID.

Change
<div id="demo">
to
<div class="demo">
and
$("#demo img[title]").tooltip('#demotip');
to
$(".demo img[title]").tooltip('#demotip');

I have a feeling you will need to make some other changes for it to work correctly, but you should be able to fumble through it ;)

If you have any issues still, it's best to post a link so we can see the FINISHED html source instead of your PHP code.