Simple problem - running jq from a jq-generated div?
Hi there,
I'd be so grateful if anyone can spare a few mins to glance at my problem...
What the below script does:
Populates .rs_details/.rs_venues/rs_headliners with information from a hidden div (this comes from php)
What I to do:
Get a jquery tooltip/lightbox (anything) to work based on a .click link that's inside one of the jquery populated divs.
For some reason it doesn't work? I can get my j query tooltips/lighbox to work anywhere except in these jquery populated divs?
ahhhh!
Hope someone can save my brain! Thanks!
-
<!---------- TEMPORARY HOLDING DIV (HIDDEN) ------------>
<div class="hidden">
<div class="nameofnight<?php echo $entry_id; ?>"><?php echo $nameofnight; ?>
</div>
<div class="headliners<?php echo $entry_id; ?>"><?php echo $headliners; ?>
</div>
<div class="details<?php echo $entry_id; ?>"><?php echo $details; ?>
</div>
<div class="venue<?php echo $entry_id; ?>">venue: <?php echo $venue; ?> price: <?php echo $price; ?>
</div>
<div class="price<?php echo $entry_id; ?>"><?php echo $price; ?>
</div>
<!-----FLYER IMAGE LIGHTBOX / TOOLTIP -------->
<div class='flyer_url<?php echo $entry_id; ?>'>
<a href='#' class="flyerlink">See Flyer</a>
</div>
<!-------------------------------------------->
<a href='#' class="flyerlink">See Flyer</a>
</div><!--close holding div--!>
<!------------------------------------------------------>
<!---------- JQUERY: CLONE AND APPEND TO DETAILS AREA ---------------->
<script src="http://code.jquery.com/jquery-latest.js"></script><script>
$(function() {
$('a.<?php echo $entry_id;?>').click(function () {
$('.right_side').children().empty();
$('.nameofnight<?php echo $entry_id; ?>').clone().appendTo('.rs_nameofnight');
$('.headliners<?php echo $entry_id; ?>').clone().appendTo('.rs_headliners');
$('.details<?php echo $entry_id; ?>').clone().appendTo('.rs_details');
$('.venue<?php echo $entry_id; ?>').clone().appendTo('.rs_venue');
$('.price<?php echo $entry_id; ?>').clone().appendTo('.rs_price');
$('.flyer_url<?php echo $entry_id; ?>').clone().appendTo('.rs_flyer_url');
});
});
</script>
<!------------------------------------------------------------------------>
<!----------------------- JQUERY: FLYER URL TOOLTIP --------------------->
<script type="text/javascript">
$(function() {
$('a.flyerlink').hover(function(e) {
var html = '<div class="tooltip">';
html += '<img src="http://www.headfirstmusic.co.uk/tommansfield/tempsite/images/placeholder-image-1.jpg" alt="image" />';
html += '</div>';
$('body').append(html).children('#tooltip').hide().fadeIn(400);
$('.tooltip').css('top', e.pageY + -20).css('left', e.pageX + 40);
}, function() {
$('.tooltip').remove();
});
$('a.flyerlink').mousemove(function(e) {
$('.tooltip').css('top', e.pageY + 30).css('left', e.pageX + 40);
});
});
</script>
<!------------------------------------------------------------------------------->
[/list]